You are here

public function PageManagerRoutesTest::providerTestAlterRoutesOverrideExisting 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::providerTestAlterRoutesOverrideExisting()

File

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

Class

PageManagerRoutesTest
Tests the page manager route subscriber.

Namespace

Drupal\Tests\page_manager\Unit

Code

public function providerTestAlterRoutesOverrideExisting() {
  $data = [];
  $data['no_slug'] = [
    '/test_route',
    '/test_route',
  ];
  $data['slug'] = [
    '/test_route/{test_route}',
    '/test_route/{test_route}',
  ];
  $data['placeholder'] = [
    '/test_route/%',
    '/test_route/{test_route}',
  ];
  $data['slug_with_default'] = [
    '/test_route/{default_exists}',
    '/test_route/{default_exists}',
  ];
  $data['placeholder_with_default'] = [
    '/test_route/%',
    '/test_route/{default_exists}',
  ];
  $data['with_requirement'] = [
    '/test_route/{foo}',
    '/test_route/{foo}',
    [
      'foo' => '\\d+',
    ],
  ];
  return $data;
}