You are here

public function DomainRedirectRequestSubscriberTest::providerDomains in Redirect 8

Data provider for the domain redirects.

Return value

array An array of requests and expected responses for the redirect domains.

File

modules/redirect_domain/tests/src/Unit/DomainRedirectRequestSubscriberTest.php, line 148

Class

DomainRedirectRequestSubscriberTest
Tests the redirect logic.

Namespace

Drupal\Tests\redirect_domain\Unit

Code

public function providerDomains() {
  $datasets = [];
  $datasets[] = [
    'http://foo.com/example',
    'http://bar.com/example',
  ];
  $datasets[] = [
    'http://example.com/foo/test/bar',
    'http://example.com/bar/foo',
  ];
  $datasets[] = [
    'http://simpleexample.com/redirect',
    'http://redirected.com/redirect',
  ];
  $datasets[] = [
    'http://nonexisting.com',
    NULL,
  ];
  $datasets[] = [
    'http://simpleexample.com/wrongpath',
    NULL,
  ];
  $datasets[] = [
    'http://foo.com/fixedredirect',
    'http://bar.com/fixedredirect',
  ];
  $datasets[] = [
    'http://wildcardtest.com/some/path',
    'http://somedomain.com/path',
  ];
  $datasets[] = [
    'http://wildcardtest.com/other/path',
    'http://wildcardredirect.com',
  ];
  $datasets[] = [
    'http://wildcardtest.com/does-not-exist',
    'http://wildcardredirect.com',
  ];
  return $datasets;
}