mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
added extra tests for changed view file extension
This commit is contained in:
parent
0bab8f8e14
commit
d0e574cbba
2 changed files with 27 additions and 0 deletions
|
@ -947,4 +947,30 @@ class ViewTest extends CakeTestCase {
|
|||
$View->render('this_is_missing');
|
||||
$result = str_replace(array("\t", "\r\n", "\n"), "", ob_get_clean());
|
||||
}
|
||||
|
||||
/**
|
||||
* testAltExt method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAltExt() {
|
||||
$this->PostsController->ext = '.alt';
|
||||
$View = new TestView($this->PostsController);
|
||||
$result = $View->render('alt_ext', false);
|
||||
$this->assertEqual($result, 'alt ext');
|
||||
}
|
||||
|
||||
/**
|
||||
* testAltBadExt method
|
||||
*
|
||||
* @expectedException MissingViewException
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function testAltBadExt() {
|
||||
$View = new TestView($this->PostsController);
|
||||
$View->render('alt_ext');
|
||||
$result = str_replace(array("\t", "\r\n", "\n"), "", ob_get_clean());
|
||||
}
|
||||
}
|
||||
|
|
1
cake/tests/test_app/views/posts/alt_ext.alt
Normal file
1
cake/tests/test_app/views/posts/alt_ext.alt
Normal file
|
@ -0,0 +1 @@
|
|||
alt ext
|
Loading…
Reference in a new issue