function NegotiationMiddlewareTest::testFormatViaQueryParameter
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php \Drupal\Tests\Core\StackMiddleware\NegotiationMiddlewareTest::testFormatViaQueryParameter()
- 8.9.x core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php \Drupal\Tests\Core\StackMiddleware\NegotiationMiddlewareTest::testFormatViaQueryParameter()
- 11.x core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php \Drupal\Tests\Core\StackMiddleware\NegotiationMiddlewareTest::testFormatViaQueryParameter()
Tests the specifying a format via query parameters gets used.
@covers ::getContentType
File
-
core/
tests/ Drupal/ Tests/ Core/ StackMiddleware/ NegotiationMiddlewareTest.php, line 57
Class
- NegotiationMiddlewareTest
- @coversDefaultClass \Drupal\Core\StackMiddleware\NegotiationMiddleware @group NegotiationMiddleware
Namespace
Drupal\Tests\Core\StackMiddlewareCode
public function testFormatViaQueryParameter() : void {
$request = new Request();
$request->query
->set('_format', 'bob');
$this->assertSame('bob', $this->contentNegotiation
->getContentType($request));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.