Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding tests for missingBehaviorClass and missingBehaviorError methods.

  • Loading branch information...
commit 9c82d19968aa708b97e9de69978bb07da26cca8f 1 parent 81cb097
@markstory markstory authored
Showing with 30 additions and 0 deletions.
  1. +30 −0 cake/tests/cases/libs/error.test.php
View
30 cake/tests/cases/libs/error.test.php
@@ -453,6 +453,36 @@ function testMissingHelperClass() {
}
/**
+ * 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
*
* @access public
Please sign in to comment.
Something went wrong with that request. Please try again.