function TrustedRedirectResponseTest::testSetTargetUrlWithTrustedUrl
@covers ::setTargetUrl
File
-
core/
tests/ Drupal/ Tests/ Core/ Routing/ TrustedRedirectResponseTest.php, line 49
Class
- TrustedRedirectResponseTest
- @coversDefaultClass \Drupal\Core\Routing\TrustedRedirectResponse[[api-linebreak]] @group Routing
Namespace
Drupal\Tests\Core\RoutingCode
public function testSetTargetUrlWithTrustedUrl() {
$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.