Commit d9dd7292 by Qiang Xue

Fixed test break.

parent eb779ff6
...@@ -5,29 +5,16 @@ namespace yiiunit\framework\web; ...@@ -5,29 +5,16 @@ namespace yiiunit\framework\web;
use Yii; use Yii;
use yii\helpers\StringHelper; use yii\helpers\StringHelper;
class MockResponse extends \yii\web\Response
{
public function send()
{
// does nothing to allow testing
}
}
/** /**
* @group web * @group web
*/ */
class ResponseTest extends \yiiunit\TestCase class ResponseTest extends \yiiunit\TestCase
{ {
/**
* @var MockResponse
*/
public $response;
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();
$this->mockApplication(); $this->mockApplication();
$this->response = new MockResponse; $this->response = new \yii\web\Response;
} }
public function rightRanges() public function rightRanges()
...@@ -50,7 +37,7 @@ class ResponseTest extends \yiiunit\TestCase ...@@ -50,7 +37,7 @@ class ResponseTest extends \yiiunit\TestCase
$fullContent = file_get_contents($dataFile); $fullContent = file_get_contents($dataFile);
$_SERVER['HTTP_RANGE'] = 'bytes=' . $rangeHeader; $_SERVER['HTTP_RANGE'] = 'bytes=' . $rangeHeader;
ob_start(); ob_start();
$this->response->sendFile($dataFile)->send(); $this->response->sendFile($dataFile)->send( );
$content = ob_get_clean(); $content = ob_get_clean();
$this->assertEquals($expectedContent, $content); $this->assertEquals($expectedContent, $content);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment