You are here

protected function PageManagerRoutesTest::assertMatchingRoute in Page Manager 8

Same name and namespace in other branches
  1. 8.4 tests/src/Unit/PageManagerRoutesTest.php \Drupal\Tests\page_manager\Unit\PageManagerRoutesTest::assertMatchingRoute()

Asserts that a route object has the expected properties.

Parameters

\Symfony\Component\Routing\Route $route: The route to test.

string $expected_path: The expected path for the route.

array $expected_defaults: The expected defaults for the route.

array $expected_requirements: The expected requirements for the route.

array $expected_options: The expected options for the route.

4 calls to PageManagerRoutesTest::assertMatchingRoute()
PageManagerRoutesTest::testAlterRoutesMultipleVariantsDifferentRequirements in tests/src/Unit/PageManagerRoutesTest.php
@covers ::alterRoutes
PageManagerRoutesTest::testAlterRoutesOverrideExisting in tests/src/Unit/PageManagerRoutesTest.php
Tests overriding an existing route.
PageManagerRoutesTest::testAlterRoutesOverrideExistingWithConfiguredParameters in tests/src/Unit/PageManagerRoutesTest.php
Tests overriding an existing route with configured parameters.
PageManagerRoutesTest::testAlterRoutesWithStatus in tests/src/Unit/PageManagerRoutesTest.php
Tests adding routes for enabled and disabled pages.

File

tests/src/Unit/PageManagerRoutesTest.php, line 434
Contains \Drupal\Tests\page_manager\Unit\PageManagerRoutesTest.

Class

PageManagerRoutesTest
Tests the page manager route subscriber.

Namespace

Drupal\Tests\page_manager\Unit

Code

protected function assertMatchingRoute(Route $route, $expected_path, array $expected_defaults, array $expected_requirements, array $expected_options) {
  $this
    ->assertEquals($expected_path, $route
    ->getPath());
  $this
    ->assertEquals($expected_defaults, $route
    ->getDefaults());
  $this
    ->assertEquals($expected_requirements, $route
    ->getRequirements());
  $this
    ->assertEquals($expected_options, $route
    ->getOptions());
}