Instantiate $offset and $maxlen at definition
This commit is contained in:
parent
0332f861c6
commit
dba8687a5d
@ -31,8 +31,8 @@ class BinaryFileResponse extends Response
|
|||||||
* @var File
|
* @var File
|
||||||
*/
|
*/
|
||||||
protected $file;
|
protected $file;
|
||||||
protected $offset;
|
protected $offset = 0;
|
||||||
protected $maxlen;
|
protected $maxlen = -1;
|
||||||
protected $deleteFileAfterSend = false;
|
protected $deleteFileAfterSend = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -206,6 +206,19 @@ class BinaryFileResponseTest extends ResponseTestCase
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testUnpreparedResponseSendsFullFile()
|
||||||
|
{
|
||||||
|
$response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200);
|
||||||
|
|
||||||
|
$data = file_get_contents(__DIR__.'/File/Fixtures/test.gif');
|
||||||
|
|
||||||
|
$this->expectOutputString($data);
|
||||||
|
$response = clone $response;
|
||||||
|
$response->sendContent();
|
||||||
|
|
||||||
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider provideInvalidRanges
|
* @dataProvider provideInvalidRanges
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user