You are here

public function RedirectDestinationTest::testGetAsArray in Drupal 8

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

@dataProvider providerGet

@covers ::getAsArray

File

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

Class

RedirectDestinationTest
@coversDefaultClass \Drupal\Core\Routing\RedirectDestination @group Routing

Namespace

Drupal\Tests\Core\Routing

Code

public function testGetAsArray(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([
    'destination' => $expected_destination,
  ], $this->redirectDestination
    ->getAsArray());
  $this
    ->assertEquals([
    'destination' => $expected_destination,
  ], $this->redirectDestination
    ->getAsArray());
}