You are here

public function ContentTypeHeaderMatcherTest::testGetRequestFilter in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Routing/ContentTypeHeaderMatcherTest.php \Drupal\Tests\Core\Routing\ContentTypeHeaderMatcherTest::testGetRequestFilter()

Tests that routes are not filtered on GET requests.

File

core/tests/Drupal/Tests/Core/Routing/ContentTypeHeaderMatcherTest.php, line 48
Contains \Drupal\Tests\Core\Routing\ContentTypeHeaderMatcherTest.

Class

ContentTypeHeaderMatcherTest
Confirm that the content types partial matcher is functioning properly.

Namespace

Drupal\Tests\Core\Routing

Code

public function testGetRequestFilter() {
  $collection = $this->fixtures
    ->sampleRouteCollection();
  $collection
    ->addCollection($this->fixtures
    ->contentRouteCollection());
  $request = Request::create('path/two', 'GET');
  $routes = $this->matcher
    ->filter($collection, $request);
  $this
    ->assertEquals(count($routes), 7, 'The correct number of routes was found.');
}