public function RedirectDestinationTest::testGet in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php \Drupal\Tests\Core\Routing\RedirectDestinationTest::testGet()
- 9 core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php \Drupal\Tests\Core\Routing\RedirectDestinationTest::testGet()
Tests destination passed via $_GET.
@dataProvider providerGet
@covers ::get
Parameters
\Symfony\Component\HttpFoundation\Request $request: The request to test.
string $expected_destination: The expected destination.
File
- core/
tests/ Drupal/ Tests/ Core/ Routing/ RedirectDestinationTest.php, line 74
Class
- RedirectDestinationTest
- @coversDefaultClass \Drupal\Core\Routing\RedirectDestination @group Routing
Namespace
Drupal\Tests\Core\RoutingCode
public function testGet(Request $request, $expected_destination) {
$this->requestStack
->push($request);
$this
->setupUrlGenerator();
// Call in twice in order to ensure it returns the same the next time.
$this
->assertEquals($expected_destination, $this->redirectDestination
->get());
$this
->assertEquals($expected_destination, $this->redirectDestination
->get());
}