Skip to content

Commit

Permalink
Adding error feedback to base class methods
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 14, 2009
1 parent 20530f5 commit 94c4e18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions cake/libs/view/helpers/js.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
/**
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions cake/tests/cases/libs/view/helpers/jquery_engine.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.