mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Currently the FormHelper fails if the Model supplied is 'Model', perhaps we need to add a special case for this
This commit is contained in:
parent
ef5650c034
commit
9304f3420b
1 changed files with 9 additions and 9 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Reference in a new issue