public function NegotiationMiddlewareTest::testFormatViaQueryParameter in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php \Drupal\Tests\Core\StackMiddleware\NegotiationMiddlewareTest::testFormatViaQueryParameter()
- 9 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 60 - Contains \Drupal\Tests\Core\StackMiddleware\NegotiationMiddlewareTest.
Class
- NegotiationMiddlewareTest
- @coversDefaultClass \Drupal\Core\StackMiddleware\NegotiationMiddleware @group NegotiationMiddleware
Namespace
Drupal\Tests\Core\StackMiddlewareCode
public function testFormatViaQueryParameter() {
$request = new Request();
$request->query
->set('_format', 'bob');
$this
->assertSame('bob', $this->contentNegotiation
->getContentType($request));
}