function TrustedRedirectResponseTest::testSetTargetUrlWithInternalUrl

Tests set target url with internal url.

@legacy-covers ::setTargetUrl

File

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

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.