public static function RedirectResponseSubscriberTest::providerTestDestinationRedirect in Drupal 9
Same name and namespace in other branches
- 8 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',
],
];
}