function RedirectResponseSubscriberTest::providerTestDestinationRedirectWithInvalidUrl

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\RedirectResponseSubscriberTest::providerTestDestinationRedirectWithInvalidUrl()
  2. 8.9.x core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\RedirectResponseSubscriberTest::providerTestDestinationRedirectWithInvalidUrl()
  3. 10 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

Class

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

Namespace

Drupal\Tests\Core\EventSubscriber

Code

public static function providerTestDestinationRedirectWithInvalidUrl() {
    $data = [];
    $data[] = [
        new Request([
            'destination' => '//example:com',
        ]),
    ];
    $data[] = [
        new Request([
            '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 base path'] = [
        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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.