You are here

public function BinaryFileResponseTest::testInvalidRequests in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/BinaryFileResponseTest.php \Symfony\Component\HttpFoundation\Tests\BinaryFileResponseTest::testInvalidRequests()

@dataProvider provideInvalidRanges

File

vendor/symfony/http-foundation/Tests/BinaryFileResponseTest.php, line 132

Class

BinaryFileResponseTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testInvalidRequests($requestRange) {
  $response = BinaryFileResponse::create(__DIR__ . '/File/Fixtures/test.gif', 200, array(
    'Content-Type' => 'application/octet-stream',
  ))
    ->setAutoEtag();

  // prepare a request for a range of the testing file
  $request = Request::create('/');
  $request->headers
    ->set('Range', $requestRange);
  $response = clone $response;
  $response
    ->prepare($request);
  $response
    ->sendContent();
  $this
    ->assertEquals(416, $response
    ->getStatusCode());

  #$this->assertEquals('', $response->headers->get('Content-Range'));
}