public function BinaryFileResponseTest::testXSendfile in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-foundation/Tests/BinaryFileResponseTest.php \Symfony\Component\HttpFoundation\Tests\BinaryFileResponseTest::testXSendfile()
File
- vendor/
symfony/ http-foundation/ Tests/ BinaryFileResponseTest.php, line 156
Class
Namespace
Symfony\Component\HttpFoundation\TestsCode
public function testXSendfile() {
$request = Request::create('/');
$request->headers
->set('X-Sendfile-Type', 'X-Sendfile');
BinaryFileResponse::trustXSendfileTypeHeader();
$response = BinaryFileResponse::create(__DIR__ . '/../README.md', 200, array(
'Content-Type' => 'application/octet-stream',
));
$response
->prepare($request);
$this
->expectOutputString('');
$response
->sendContent();
$this
->assertContains('README.md', $response->headers
->get('X-Sendfile'));
}