You are here

public function ContentTypeHeaderMatcherTest::testSafeRequestFilter in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Routing/ContentTypeHeaderMatcherTest.php \Drupal\Tests\Core\Routing\ContentTypeHeaderMatcherTest::testSafeRequestFilter()
  2. 9 core/tests/Drupal/Tests/Core/Routing/ContentTypeHeaderMatcherTest.php \Drupal\Tests\Core\Routing\ContentTypeHeaderMatcherTest::testSafeRequestFilter()

Tests that routes are not filtered on safe requests.

@dataProvider providerTestSafeRequestFilter

File

core/tests/Drupal/Tests/Core/Routing/ContentTypeHeaderMatcherTest.php, line 49

Class

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

Namespace

Drupal\Tests\Core\Routing

Code

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