diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index dd8895ae22e..253cce874e1 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1107,28 +1107,27 @@ function file($fieldName, $options = array()) { } /** - * Creates a button tag. + * Creates a ', 'image' => '', 'tableheader' => '%s', 'tableheaderrow' => '%s', diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index d195b11cb42..007b4f9f166 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -4491,19 +4491,13 @@ function testFileUploadOnOtherModel() { */ function testButton() { $result = $this->Form->button('Hi'); - $this->assertTags($result, array('input' => array('type' => 'button', 'value' => 'Hi'))); + $this->assertTags($result, array('button' => array('type' => 'submit'), 'Hi', '/button')); - $result = $this->Form->button('Clear Form', array('type' => 'clear')); - $this->assertTags($result, array('input' => array('type' => 'clear', 'value' => 'Clear Form'))); + $result = $this->Form->button('Clear Form >', array('type' => 'reset')); + $this->assertTags($result, array('button' => array('type' => 'reset'), 'Clear Form >', '/button')); - $result = $this->Form->button('Reset Form', array('type' => 'reset')); - $this->assertTags($result, array('input' => array('type' => 'reset', 'value' => 'Reset Form'))); - - $result = $this->Form->button('Options', array('type' => 'reset', 'name' => 'Post.options')); - $this->assertTags($result, array('input' => array('type' => 'reset', 'name' => 'data[Post][options]', 'id' => 'PostOptions', 'value' => 'Options'))); - - $result = $this->Form->button('Options', array('type' => 'reset', 'name' => 'Post.options', 'id' => 'Opt')); - $this->assertTags($result, array('input' => array('type' => 'reset', 'name' => 'data[Post][options]', 'id' => 'Opt', 'value' => 'Options'))); + $result = $this->Form->button('', array('type' => 'reset', 'escape' => true)); + $this->assertTags($result, array('button' => array('type' => 'reset'), '<Clear Form>', '/button')); $result = $this->Form->button('Upload Text', array('onClick' => "$('#postAddForm').ajaxSubmit({target: '#postTextUpload', url: '/posts/text'});return false;'", 'escape' => false)); $this->assertNoPattern('/\&039/', $result);