You are here

public function AcceptHeaderMatcherTest::acceptFilterProvider in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Routing/AcceptHeaderMatcherTest.php \Drupal\Tests\Core\Routing\AcceptHeaderMatcherTest::acceptFilterProvider()

Provides data for the Accept header filtering test.

See also

Drupal\Tests\Core\Routing\AcceptHeaderMatcherTest::testAcceptFiltering()

File

core/tests/Drupal/Tests/Core/Routing/AcceptHeaderMatcherTest.php, line 46

Class

AcceptHeaderMatcherTest
Confirm that the mime types partial matcher is functioning properly.

Namespace

Drupal\Tests\Core\Routing

Code

public function acceptFilterProvider() {
  return [
    // Check that JSON routes get filtered and prioritized correctly.
    [
      'application/json, text/xml;q=0.9',
      'json',
      'route_c',
      'route_e',
    ],
    // Tests a JSON request with alternative JSON MIME type Accept header.
    [
      'application/x-json, text/xml;q=0.9',
      'json',
      'route_c',
      'route_e',
    ],
    // Tests a standard HTML request.
    [
      'text/html, text/xml;q=0.9',
      'html',
      'route_e',
      'route_c',
    ],
  ];
}