public function ResponseTest::testPrepareRemovesContentForHeadRequests in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-foundation/Tests/ResponseTest.php \Symfony\Component\HttpFoundation\Tests\ResponseTest::testPrepareRemovesContentForHeadRequests()
File
- vendor/
symfony/ http-foundation/ Tests/ ResponseTest.php, line 495
Class
Namespace
Symfony\Component\HttpFoundation\TestsCode
public function testPrepareRemovesContentForHeadRequests() {
$response = new Response('foo');
$request = Request::create('/', 'HEAD');
$length = 12345;
$response->headers
->set('Content-Length', $length);
$response
->prepare($request);
$this
->assertEquals('', $response
->getContent());
$this
->assertEquals($length, $response->headers
->get('Content-Length'), 'Content-Length should be as if it was GET; see RFC2616 14.13');
}