Skip to content

Commit

Permalink
added extra tests for changed view file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeram authored and markstory committed Mar 26, 2011
1 parent 0bab8f8 commit d0e574c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cake/tests/cases/libs/view/view.test.php
Expand Up @@ -947,4 +947,30 @@ function testBadExt() {
$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 change: 1 addition & 0 deletions cake/tests/test_app/views/posts/alt_ext.alt
@@ -0,0 +1 @@
alt ext

0 comments on commit d0e574c

Please sign in to comment.