function TrustedRedirectResponseTest::testSetTargetUrlWithInternalUrl

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php \Drupal\Tests\Core\Routing\TrustedRedirectResponseTest::testSetTargetUrlWithInternalUrl()
  2. 10 core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php \Drupal\Tests\Core\Routing\TrustedRedirectResponseTest::testSetTargetUrlWithInternalUrl()
  3. 9 core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php \Drupal\Tests\Core\Routing\TrustedRedirectResponseTest::testSetTargetUrlWithInternalUrl()
  4. 8.9.x core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php \Drupal\Tests\Core\Routing\TrustedRedirectResponseTest::testSetTargetUrlWithInternalUrl()

Tests set target url with internal url.

File

core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php, line 29

Class

TrustedRedirectResponseTest
Tests Drupal\Core\Routing\TrustedRedirectResponse.

Namespace

Drupal\Tests\Core\Routing

Code

public function testSetTargetUrlWithInternalUrl() : void {
  $redirect_response = new TrustedRedirectResponse('/example');
  $redirect_response->setTargetUrl('/example2');
  $this->assertEquals('/example2', $redirect_response->getTargetUrl());
}

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