From 9304f3420b855d2bc52bfff2cd407e3fb9a493ce Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Thu, 14 Jul 2011 11:05:41 -0430 Subject: [PATCH] Currently the FormHelper fails if the Model supplied is 'Model', perhaps we need to add a special case for this --- .../Test/Case/View/Helper/FormHelperTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index 0a4fbceed..77922fb2a 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -1882,7 +1882,7 @@ class FormHelperTest extends CakeTestCase { 'label' => array('for' => 'ObjectField'), 'Field', '/label', - 'input' => array('type' => 'text', 'name' => 'data[Object][field]', 'id' => 'ModelField'), + 'input' => array('type' => 'text', 'name' => 'data[Object][field]', 'id' => 'ObjectField'), 'A message to you, Rudy', '/div' ); @@ -2212,14 +2212,14 @@ class FormHelperTest extends CakeTestCase { $this->assertTags($result, $expected); $this->View->viewVars['users'] = array('value' => 'good', 'other' => 'bad'); - $this->Form->request->data = array('Model' => array('user_id' => null)); - $result = $this->Form->input('Model.user_id', array('empty' => 'Some Empty')); + $this->Form->request->data = array('Thing' => array('user_id' => null)); + $result = $this->Form->input('Thing.user_id', array('empty' => 'Some Empty')); $expected = array( 'div' => array('class' => 'input select'), - 'label' => array('for' => 'ModelUserId'), + 'label' => array('for' => 'ThingUserId'), 'User', '/label', - 'select' => array('name' => 'data[Model][user_id]', 'id' => 'ModelUserId'), + 'select' => array('name' => 'data[Thing][user_id]', 'id' => 'ThingUserId'), array('option' => array('value' => '')), 'Some Empty', '/option', @@ -2235,14 +2235,14 @@ class FormHelperTest extends CakeTestCase { $this->assertTags($result, $expected); $this->View->viewVars['users'] = array('value' => 'good', 'other' => 'bad'); - $this->Form->request->data = array('Model' => array('user_id' => 'value')); - $result = $this->Form->input('Model.user_id', array('empty' => 'Some Empty')); + $this->Form->request->data = array('Thing' => array('user_id' => 'value')); + $result = $this->Form->input('Thing.user_id', array('empty' => 'Some Empty')); $expected = array( 'div' => array('class' => 'input select'), - 'label' => array('for' => 'ModelUserId'), + 'label' => array('for' => 'ThingUserId'), 'User', '/label', - 'select' => array('name' => 'data[Model][user_id]', 'id' => 'ModelUserId'), + 'select' => array('name' => 'data[Thing][user_id]', 'id' => 'ThingUserId'), array('option' => array('value' => '')), 'Some Empty', '/option',