Skip to content

Commit

Permalink
Instantiate $offset and $maxlen at definition
Browse files Browse the repository at this point in the history
  • Loading branch information
j4nr6n committed Aug 27, 2018
1 parent 0332f86 commit dba8687
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/HttpFoundation/BinaryFileResponse.php
Expand Up @@ -31,8 +31,8 @@ class BinaryFileResponse extends Response
* @var File
*/
protected $file;
protected $offset;
protected $maxlen;
protected $offset = 0;
protected $maxlen = -1;
protected $deleteFileAfterSend = false;

/**
Expand Down
Expand Up @@ -206,6 +206,19 @@ public function provideFullFileRanges()
);
}

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
*/
Expand Down

0 comments on commit dba8687

Please sign in to comment.