[HttpFoundation] add test to ensure that Content-Length is preserved on HEAD method

This commit is contained in:
Roman Marintšenko 2013-08-28 22:35:29 +03:00
parent 32947b2fc8
commit 42f0596f1a

View File

@ -361,9 +361,12 @@ class ResponseTest extends ResponseTestCase
$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');
}
public function testPrepareSetsPragmaOnHttp10Only()