function TrustedRedirectResponseTest::testSetTargetUrlWithTrustedUrl
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php \Drupal\Tests\Core\Routing\TrustedRedirectResponseTest::testSetTargetUrlWithTrustedUrl()
- 10 core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php \Drupal\Tests\Core\Routing\TrustedRedirectResponseTest::testSetTargetUrlWithTrustedUrl()
- 9 core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php \Drupal\Tests\Core\Routing\TrustedRedirectResponseTest::testSetTargetUrlWithTrustedUrl()
- 8.9.x core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php \Drupal\Tests\Core\Routing\TrustedRedirectResponseTest::testSetTargetUrlWithTrustedUrl()
Tests set target url with trusted url.
File
-
core/
tests/ Drupal/ Tests/ Core/ Routing/ TrustedRedirectResponseTest.php, line 55
Class
Namespace
Drupal\Tests\Core\RoutingCode
public function testSetTargetUrlWithTrustedUrl() : void {
$redirect_response = new TrustedRedirectResponse('/example');
$redirect_response->setTrustedTargetUrl('http://good-external-url.com/example');
$this->assertEquals('http://good-external-url.com/example', $redirect_response->getTargetUrl());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.