Fixing failing test, picked in from 1.2.

This commit is contained in:
mark_story 2009-11-13 09:53:31 -05:00
parent bfde6b81fe
commit d93c94f702
2 changed files with 4 additions and 3 deletions

View file

@ -172,7 +172,8 @@ class FormHelper extends AppHelper {
if (is_array($model) && empty($options)) { if (is_array($model) && empty($options)) {
$options = $model; $options = $model;
$model = null; $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]; $model = $this->params['models'][0];
$this->defaultModel = $this->params['models'][0]; $this->defaultModel = $this->params['models'][0];
} elseif (empty($model) && empty($this->params['models'])) { } elseif (empty($model) && empty($this->params['models'])) {

View file

@ -5056,14 +5056,14 @@ class FormHelperTest extends CakeTestCase {
$result = $this->Form->create(array('url' => array('action' => 'index', 'param'))); $result = $this->Form->create(array('url' => array('action' => 'index', 'param')));
$expected = array( $expected = array(
'form' => 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*/'), 'fieldset' => array('style' => 'preg:/display\s*\:\s*none;\s*/'),
'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'), 'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'),
'/fieldset' '/fieldset'
); );
$this->assertTags($result, $expected); $this->assertTags($result, $expected);
} }
/** /**