Skip to content

Commit

Permalink
Adding tests for missingBehaviorClass and missingBehaviorError methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Aug 30, 2009
1 parent 81cb097 commit 9c82d19
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions cake/tests/cases/libs/error.test.php
Expand Up @@ -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
*
Expand Down

0 comments on commit 9c82d19

Please sign in to comment.