You are here

public function RouteAttributesTest::providerTestExtractRawAttributes in Page Manager 8

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

File

tests/src/Unit/RouteAttributesTest.php, line 31
Contains \Drupal\Tests\page_manager\Unit\RouteAttributesTest.

Class

RouteAttributesTest
@coversDefaultClass \Drupal\page_manager\Routing\RouteAttributes @group PageManager

Namespace

Drupal\Tests\page_manager\Unit

Code

public function providerTestExtractRawAttributes() {
  $data = [];
  $data['no-parameters'] = [
    new Route('/prefix/a'),
    'a_route',
    '/prefix',
    [],
  ];
  $data['no-matching-parameters'] = [
    new Route('/prefix/{x}'),
    'a_route',
    '/different-prefix/b',
    [],
  ];
  $data['matching-parameters'] = [
    new Route('/prefix/{x}'),
    'a_route',
    '/prefix/b',
    [
      'x' => 'b',
    ],
  ];
  $data['with-defaults'] = [
    new Route('/prefix/{x}', [
      'foo' => 'bar',
    ]),
    'a_route',
    '/different-prefix/b',
    [
      'foo' => 'bar',
    ],
  ];
  return $data;
}