Add test case for #2750

This commit is contained in:
mark_story 2014-04-07 21:26:11 -04:00
parent 40b7694891
commit 7eb569c439

View file

@ -129,6 +129,23 @@ class AssetDispatcherTest extends CakeTestCase {
$this->assertEquals($time->format('D, j M Y H:i:s') . ' GMT', $response->modified());
}
/**
* Test 404 status code is set on missing asset.
*
* @return void
*/
public function test404OnMissingFile() {
$filter = new AssetDispatcher();
$response = $this->getMock('CakeResponse', array('_sendHeader'));
$request = new CakeRequest('/theme/test_theme/img/nope.gif');
$event = new CakeEvent('Dispatcher.beforeRequest', $this, compact('request', 'response'));
$response = $filter->beforeDispatch($event);
$this->assertTrue($event->isStopped());
$this->assertEquals(404, $response->statusCode());
}
/**
* Test that no exceptions are thrown for //index.php type URLs.
*