Skip to content
Permalink
Browse files

Fix file() not actually emitting files.

Because the response's stream was not set, the file
response would never actually be sent.
  • Loading branch information...
markstory committed Dec 9, 2016
1 parent 5be9f45 commit 539304b0a5d142322302ab1c6b7ad6b7ca2283b7
Showing with 6 additions and 2 deletions.
  1. +1 −0 src/Network/Response.php
  2. +5 −2 tests/TestCase/Network/ResponseTest.php
@@ -2158,6 +2158,7 @@ public function file($path, array $options = [])
}
$this->_file = $file;
$this->stream = new Stream($file->path, 'rb');
}
public function withFile($path, array $options = [])
@@ -1643,9 +1643,12 @@ public function testFile()
ob_start();
$result = $response->send();
$output = ob_get_clean();
$this->assertEquals("/* this is the test asset css file */", trim($output));
$this->assertTrue($result !== false);
$output = ob_get_clean();
$expected = "/* this is the test asset css file */";
$this->assertEquals($expected, trim($output));
$this->assertEquals($expected, trim($response->getBody()->getContents()));
}
/**

0 comments on commit 539304b

Please sign in to comment.
You can’t perform that action at this time.