Skip to content
Permalink
Browse files

Adding tests for missingBehaviorClass and missingBehaviorError methods.

  • Loading branch information...
markstory committed Aug 30, 2009
1 parent 81cb097 commit 9c82d19968aa708b97e9de69978bb07da26cca8f
Showing with 30 additions and 0 deletions.
  1. +30 −0 cake/tests/cases/libs/error.test.php
@@ -452,6 +452,36 @@ function testMissingHelperClass() {
$this->assertPattern('/(\/|\\\)my_custom.php/', $result);
}
/**
* test missingBehaviorFile method
*
* @access public
* @return void
*/
function testMissingBehaviorFile() {
ob_start();
$TestErrorHandler = new TestErrorHandler('missingBehaviorFile', array('behavior' => 'MyCustom', 'file' => 'my_custom.php'));
$result = ob_get_clean();
$this->assertPattern('/<h2>Missing Behavior File<\/h2>/', $result);
$this->assertPattern('/Create the class below in file:/', $result);
$this->assertPattern('/(\/|\\\)my_custom.php/', $result);
}
/**
* test MissingBehaviorClass method
*
* @access public
* @return void
*/
function testMissingBehaviorClass() {
ob_start();
$TestErrorHandler = new TestErrorHandler('missingBehaviorClass', array('behavior' => 'MyCustom', 'file' => 'my_custom.php'));
$result = ob_get_clean();
$this->assertPattern('/<h2>Missing Behavior Class<\/h2>/', $result);
$this->assertPattern('/The behavior class <em>MyCustomBehavior<\/em> can not be found or does not exist./', $result);
$this->assertPattern('/(\/|\\\)my_custom.php/', $result);
}
/**
* testMissingComponentFile method
*

0 comments on commit 9c82d19

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