Permalink
Browse files

Adding error feedback to base class methods

  • Loading branch information...
1 parent 20530f5 commit 94c4e18112a23ece8698779bc73991bb65111e68 @markstory markstory committed Mar 14, 2009
Showing with 5 additions and 5 deletions.
  1. +4 −3 cake/libs/view/helpers/js.php
  2. +1 −2 cake/tests/cases/libs/view/helpers/jquery_engine.test.php
@@ -485,6 +485,7 @@ function getCache($clear = true) {
* @return object instance of $this. Allows chained methods.
**/
function get($selector, $multiple = false) {
+ trigger_error(sprintf(__('%s does not have get() implemented', true), get_class($this)), E_USER_WARNING);
return $this;
}
/**
@@ -496,7 +497,7 @@ function get($selector, $multiple = false) {
* @return string completed event handler
**/
function event($type, $callback, $wrap = false) {
-
+ trigger_error(sprintf(__('%s does not have event() implemented', true), get_class($this)), E_USER_WARNING);
}
/**
* Create a domReady event. This is a special event in many libraries
@@ -505,7 +506,7 @@ function event($type, $callback, $wrap = false) {
* @return string completed domReady method
**/
function domReady($functionBody) {
-
+ trigger_error(sprintf(__('%s does not have domReady() implemented', true), get_class($this)), E_USER_WARNING);
}
/**
* Create an iteration over the current selection result.
@@ -514,7 +515,7 @@ function domReady($functionBody) {
* @return string completed iteration
**/
function each($callback) {
-
+ trigger_error(sprintf(__('%s does not have each() implemented', true), get_class($this)), E_USER_WARNING);
}
/**
* Parse an options assoc array into an Javascript object literal.
@@ -95,8 +95,7 @@ function testEach() {
$result = $this->Jquery->get('#foo')->each('$(this).hide();');
$expected = "\$('#foo').each(function () {\$(this).hide();});";
$this->assertEqual($result, $expected);
-
}
-
+
}
?>

0 comments on commit 94c4e18

Please sign in to comment.