// prepare a request for a range of the testing file
$request = Request::
create('/'
);
$request->headers->
set('If-Range',
$etag);
$request->headers->
set('Range',
$requestRange);
$file =
fopen(__DIR__.'/File/Fixtures/test.gif', 'r'
);
fseek($file,
$offset);
$data =
fread($file,
$length);
fclose($file);
$this->
expectOutputString($data);
$response =
clone $response;
$response->
prepare($request);
$response->
sendContent();
$this->
assertEquals(206,
$response->
getStatusCode());
$this->
assertEquals($responseRange,
$response->headers->
get('Content-Range'
));
$this->
assertSame((string) $length,
$response->headers->
get('Content-Length'
));
} /**
* @dataProvider provideRanges
*/