From d93c94f70249236790adca70b94338e95b2fc4c5 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 13 Nov 2009 09:53:31 -0500 Subject: [PATCH] Fixing failing test, picked in from 1.2. --- cake/libs/view/helpers/form.php | 3 ++- cake/tests/cases/libs/view/helpers/form.test.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 002f86622..8fb6888cf 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -172,7 +172,8 @@ class FormHelper extends AppHelper { if (is_array($model) && empty($options)) { $options = $model; $model = null; - } elseif (empty($model) && $model !== false && !empty($this->params['models'])) { + } + if (empty($model) && $model !== false && !empty($this->params['models'])) { $model = $this->params['models'][0]; $this->defaultModel = $this->params['models'][0]; } elseif (empty($model) && empty($this->params['models'])) { diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 81a8b032a..2f46d62b5 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -5056,14 +5056,14 @@ class FormHelperTest extends CakeTestCase { $result = $this->Form->create(array('url' => array('action' => 'index', 'param'))); $expected = array( 'form' => array( - 'id' => 'ContactAddForm', 'method' => 'post', 'action' => '/contacts/index/param' + 'id' => 'ContactAddForm', 'method' => 'post', 'action' => '/contacts/index/param', + 'accept-charset' => 'utf-8' ), 'fieldset' => array('style' => 'preg:/display\s*\:\s*none;\s*/'), 'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'), '/fieldset' ); $this->assertTags($result, $expected); - } /**