mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Adding tests for missingBehaviorClass and missingBehaviorError methods.
This commit is contained in:
parent
81cb097959
commit
9c82d19968
1 changed files with 30 additions and 0 deletions
|
@ -452,6 +452,36 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
$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
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue