function RedirectDestinationTest::testGetAsArray

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

Tests get as array.

Attributes

#[DataProvider('providerGet')]

File

core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php, line 89

Class

RedirectDestinationTest
Tests Drupal\Core\Routing\RedirectDestination.

Namespace

Drupal\Tests\Core\Routing

Code

public function testGetAsArray(Request $request, $expected_destination) : void {
  $this->requestStack
    ->push($request);
  $this->setupUrlGenerator();
  // Call in twice in order to ensure it returns the same the next time.
  $this->assertEquals([
    'destination' => $expected_destination,
  ], $this->redirectDestination
    ->getAsArray());
  $this->assertEquals([
    'destination' => $expected_destination,
  ], $this->redirectDestination
    ->getAsArray());
}

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