function RedirectResponseSubscriberTest::providerTestDestinationRedirect
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\RedirectResponseSubscriberTest::providerTestDestinationRedirect()
- 10 core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\RedirectResponseSubscriberTest::providerTestDestinationRedirect()
- 11.x core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\RedirectResponseSubscriberTest::providerTestDestinationRedirect()
Data provider for testDestinationRedirect().
See also
\Drupal\Tests\Core\EventSubscriber\RedirectResponseSubscriberTest::testDestinationRedirect()
File
-
core/
tests/ Drupal/ Tests/ Core/ EventSubscriber/ RedirectResponseSubscriberTest.php, line 102
Class
- RedirectResponseSubscriberTest
- @coversDefaultClass \Drupal\Core\EventSubscriber\RedirectResponseSubscriber @group EventSubscriber
Namespace
Drupal\Tests\Core\EventSubscriberCode
public static function providerTestDestinationRedirect() {
return [
[
new Request(),
FALSE,
],
[
new Request([
'destination' => 'test',
]),
'http://example.com/drupal/test',
],
[
new Request([
'destination' => '/drupal/test',
]),
'http://example.com/drupal/test',
],
[
new Request([
'destination' => 'example.com',
]),
'http://example.com/drupal/example.com',
],
[
new Request([
'destination' => 'example:com',
]),
'http://example.com/drupal/example:com',
],
[
new Request([
'destination' => 'javascript:alert(0)',
]),
'http://example.com/drupal/javascript:alert(0)',
],
[
new Request([
'destination' => 'http://example.com/drupal/',
]),
'http://example.com/drupal/',
],
[
new Request([
'destination' => 'http://example.com/drupal/test',
]),
'http://example.com/drupal/test',
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.