diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index 9a968eaf6..96d31385b 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -6073,6 +6073,37 @@ class FormHelperTest extends CakeTestCase { '/div' ); $this->assertTags($result, $expected); + + $this->Form->request->data = array(); + $this->Form->request['controller'] = 'contacts'; + $this->Form->request['models'] = array('Contact' => array('plugin' => null, 'className' => 'Contact')); + $result = $this->Form->create(array('url' => array('action' => 'index', 'param'), 'default' => false)); + $expected = array( + 'form' => array( + 'id' => 'ContactAddForm', 'method' => 'post', 'onsubmit' => 'event.returnValue = false; return false;', 'action' => '/contacts/index/param', + 'accept-charset' => 'utf-8' + ), + 'div' => array('style' => 'display:none;'), + 'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'), + '/div' + ); + $this->assertTags($result, $expected); + + $this->Form->request->data = array(); + $this->Form->request['controller'] = 'contacts'; + $this->Form->request['models'] = array('Contact' => array('plugin' => null, 'className' => 'Contact')); + $result = $this->Form->create(array('url' => array('action' => 'index', 'param'), 'default' => false, 'onsubmit' => 'someFunction();')); + + $expected = array( + 'form' => array( + 'id' => 'ContactAddForm', 'method' => 'post', 'onsubmit' => 'someFunction(); event.returnValue = false; return false;', 'action' => '/contacts/index/param', + 'accept-charset' => 'utf-8' + ), + 'div' => array('style' => 'display:none;'), + 'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'), + '/div' + ); + $this->assertTags($result, $expected); } /**