Permalink
Browse files

Currently the FormHelper fails if the Model supplied is 'Model', perh…

…aps we need to add a special case for this
  • Loading branch information...
1 parent ef5650c commit 9304f3420b855d2bc52bfff2cd407e3fb9a493ce @lorenzo lorenzo committed Jul 14, 2011
Showing with 9 additions and 9 deletions.
  1. +9 −9 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
View
18 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -1882,7 +1882,7 @@ public function testInput() {
'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 @@ public function testInputSelectType() {
$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 @@ public function testInputSelectType() {
$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',

0 comments on commit 9304f34

Please sign in to comment.