You are here

public function VariantRouteFilterTest::testFilterEmptyCollection in Page Manager 8.4

Same name and namespace in other branches
  1. 8 tests/src/Unit/VariantRouteFilterTest.php \Drupal\Tests\page_manager\Unit\VariantRouteFilterTest::testFilterEmptyCollection()

@covers ::filter

File

tests/src/Unit/VariantRouteFilterTest.php, line 86

Class

VariantRouteFilterTest
@coversDefaultClass \Drupal\page_manager\Routing\VariantRouteFilter @group PageManager

Namespace

Drupal\Tests\page_manager\Unit

Code

public function testFilterEmptyCollection() {
  $route_collection = new RouteCollection();
  $request = new Request();
  $this->currentPath
    ->getPath($request)
    ->shouldNotBeCalled();
  $result = $this->routeFilter
    ->filter($route_collection, $request);
  $expected = [];
  $this
    ->assertSame($expected, $result
    ->all());
  $this
    ->assertSame([], $request->attributes
    ->all());
}