Adding error feedback to base class methods

This commit is contained in:
mark_story 2009-03-14 00:10:43 -04:00
parent 20530f5ffb
commit 94c4e18112
2 changed files with 5 additions and 5 deletions

View file

@ -485,6 +485,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return object instance of $this. Allows chained methods. * @return object instance of $this. Allows chained methods.
**/ **/
function get($selector, $multiple = false) { function get($selector, $multiple = false) {
trigger_error(sprintf(__('%s does not have get() implemented', true), get_class($this)), E_USER_WARNING);
return $this; return $this;
} }
/** /**
@ -496,7 +497,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return string completed event handler * @return string completed event handler
**/ **/
function event($type, $callback, $wrap = false) { 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 * Create a domReady event. This is a special event in many libraries
@ -505,7 +506,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return string completed domReady method * @return string completed domReady method
**/ **/
function domReady($functionBody) { 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. * Create an iteration over the current selection result.
@ -514,7 +515,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return string completed iteration * @return string completed iteration
**/ **/
function each($callback) { 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. * Parse an options assoc array into an Javascript object literal.

View file

@ -95,8 +95,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
$result = $this->Jquery->get('#foo')->each('$(this).hide();'); $result = $this->Jquery->get('#foo')->each('$(this).hide();');
$expected = "\$('#foo').each(function () {\$(this).hide();});"; $expected = "\$('#foo').each(function () {\$(this).hide();});";
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
} }
?> ?>