Skip to content
Permalink
Browse files

Removed deprecated MediaView.

  • Loading branch information...
ADmad committed Aug 25, 2013
1 parent 803cce3 commit 56c4a9a4453fada4f8eb231defc7c3d65f4c51be
@@ -353,7 +353,7 @@ public function testListObjects() {
$this->assertTrue(in_array('AuthComponent', $result));
$result = App::objects('View', null, false);
$this->assertTrue(in_array('MediaView', $result));
$this->assertTrue(in_array('JsonView', $result));
$result = App::objects('View/Helper', null, false);
$this->assertTrue(in_array('HtmlHelper', $result));
@@ -1100,6 +1100,62 @@ public function testFile() {
$this->assertTrue($result !== false);
}
/**
* testFileWithDownloadAndName
*
* @return void
*/
public function testFileWithDownloadAndName() {
$response = $this->getMock('Cake\Network\Response', array(
'header',
'type',
'download',
'_sendHeader',
'_setContentType',
'_isActive',
'_clearBuffer',
'_flushBuffer'
));
$response->expects($this->exactly(1))
->method('type')
->with('css')
->will($this->returnArgument(0));
$response->expects($this->once())
->method('download')
->with('something_special.css');
$response->expects($this->at(2))
->method('header')
->with('Accept-Ranges', 'bytes');
$response->expects($this->at(3))
->method('header')
->with('Content-Length', 38);
$response->expects($this->once())->method('_clearBuffer');
$response->expects($this->once())->method('_flushBuffer');
$response->expects($this->exactly(1))
->method('_isActive')
->will($this->returnValue(true));
$response->file(
CAKE . 'Test' . DS . 'TestApp' . DS . 'vendor' . DS . 'css' . DS . 'test_asset.css',
array(
'name' => 'something_special.css',
'download' => true,
)
);
ob_start();
$result = $response->send();
$output = ob_get_clean();
$this->assertEquals("/* this is the test asset css file */\n", $output);
$this->assertTrue($result !== false);
}
/**
* testFileWithUnknownFileTypeGeneric method
*

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

0 comments on commit 56c4a9a

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