mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Add test case for #2750
This commit is contained in:
parent
40b7694891
commit
7eb569c439
1 changed files with 17 additions and 0 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue