From a8040506b0288683feb38602b1054ce3c7a2795b Mon Sep 17 00:00:00 2001 From: ADmad Date: Thu, 21 Jan 2010 22:03:03 +0530 Subject: [PATCH] Fixing spacing between button tag attributes. Fixes #241 --- cake/libs/view/helpers/form.php | 2 +- cake/tests/cases/libs/view/helpers/form.test.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index e8023ba96..4f83ef261 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1170,7 +1170,7 @@ class FormHelper extends AppHelper { return sprintf( $this->Html->tags['button'], $options['type'], - $this->_parseAttributes($options, array('type'), '', ' '), + $this->_parseAttributes($options, array('type'), ' ', ''), $title ); } diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index b9ee7dc99..8dc5286ee 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -4753,6 +4753,9 @@ class FormHelperTest extends CakeTestCase { $result = $this->Form->button('Clear Form >', array('type' => 'reset')); $this->assertTags($result, array('button' => array('type' => 'reset'), 'Clear Form >', '/button')); + $result = $this->Form->button('Clear Form >', array('type' => 'reset', 'id' => 'clearForm')); + $this->assertTags($result, array('button' => array('type' => 'reset', 'id' => 'clearForm'), 'Clear Form >', '/button')); + $result = $this->Form->button('', array('type' => 'reset', 'escape' => true)); $this->assertTags($result, array('button' => array('type' => 'reset'), '<Clear Form>', '/button'));