You are here

public function RedirectResponseSubscriberTest::providerTestDestinationRedirectWithInvalidUrl in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\RedirectResponseSubscriberTest::providerTestDestinationRedirectWithInvalidUrl()

Data provider for testDestinationRedirectWithInvalidUrl().

File

core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php, line 193
Contains \Drupal\Tests\Core\EventSubscriber\RedirectResponseSubscriberTest.

Class

RedirectResponseSubscriberTest
@coversDefaultClass \Drupal\Core\EventSubscriber\RedirectResponseSubscriber @group EventSubscriber

Namespace

Drupal\Tests\Core\EventSubscriber

Code

public function providerTestDestinationRedirectWithInvalidUrl() {
  $data = [];
  $data[] = [
    new Request(array(
      'destination' => '//example:com',
    )),
  ];
  $data[] = [
    new Request(array(
      'destination' => '//example:com/test',
    )),
  ];
  $data['absolute external url'] = [
    new Request([
      'destination' => 'http://example.com',
    ]),
  ];
  $data['absolute external url with folder'] = [
    new Request([
      'destination' => 'http://example.ca/drupal',
    ]),
  ];
  $data['path without drupal basepath'] = [
    new Request([
      'destination' => '/test',
    ]),
  ];
  $data['path with URL'] = [
    new Request([
      'destination' => '/example.com',
    ]),
  ];
  $data['path with URL and two slashes'] = [
    new Request([
      'destination' => '//example.com',
    ]),
  ];
  return $data;
}