mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Fixing typo in prototype engine helper. Fixes #172
This commit is contained in:
parent
38f65bdc24
commit
906eb82e9b
2 changed files with 13 additions and 2 deletions
|
@ -37,7 +37,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
**/
|
||||
var $_optionMap = array(
|
||||
'request' => array(
|
||||
'async' => 'asyncrhronous',
|
||||
'async' => 'asynchronous',
|
||||
'data' => 'parameters',
|
||||
'before' => 'onCreate',
|
||||
'success' => 'onSuccess',
|
||||
|
|
|
@ -227,7 +227,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
|
|||
));
|
||||
$expected = 'var jsRequest = new Ajax.Request("/people/edit/1", {method:"post", onComplete:doSuccess, onFailure:handleError, parameters:$("element").serialize()});';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
|
||||
$result = $this->Proto->request('/people/edit/1', array(
|
||||
'method' => 'post',
|
||||
'before' => 'doBefore();',
|
||||
|
@ -237,6 +237,17 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
|
|||
));
|
||||
$expected = 'var jsRequest = new Ajax.Request("/people/edit/1", {method:"post", onComplete:function (transport) {doComplete();}, onCreate:function (transport) {doBefore();}, onFailure:function (response, jsonHeader) {handleError();}, onSuccess:function (response, jsonHeader) {doSuccess();}});';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->Proto->request('/people/edit/1', array(
|
||||
'async' => false,
|
||||
'method' => 'post',
|
||||
'before' => 'doBefore();',
|
||||
'success' => 'doSuccess();',
|
||||
'complete' => 'doComplete();',
|
||||
'error' => 'handleError();',
|
||||
));
|
||||
$expected = 'var jsRequest = new Ajax.Request("/people/edit/1", {asynchronous:false, method:"post", onComplete:function (transport) {doComplete();}, onCreate:function (transport) {doBefore();}, onFailure:function (response, jsonHeader) {handleError();}, onSuccess:function (response, jsonHeader) {doSuccess();}});';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue