mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-19 07:59:54 +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'),
|
'label' => array('for' => 'ObjectField'),
|
||||||
'Field',
|
'Field',
|
||||||
'/label',
|
'/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',
|
'A message to you, Rudy',
|
||||||
'/div'
|
'/div'
|
||||||
);
|
);
|
||||||
|
@ -2212,14 +2212,14 @@ class FormHelperTest extends CakeTestCase {
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$this->View->viewVars['users'] = array('value' => 'good', 'other' => 'bad');
|
$this->View->viewVars['users'] = array('value' => 'good', 'other' => 'bad');
|
||||||
$this->Form->request->data = array('Model' => array('user_id' => null));
|
$this->Form->request->data = array('Thing' => array('user_id' => null));
|
||||||
$result = $this->Form->input('Model.user_id', array('empty' => 'Some Empty'));
|
$result = $this->Form->input('Thing.user_id', array('empty' => 'Some Empty'));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'div' => array('class' => 'input select'),
|
'div' => array('class' => 'input select'),
|
||||||
'label' => array('for' => 'ModelUserId'),
|
'label' => array('for' => 'ThingUserId'),
|
||||||
'User',
|
'User',
|
||||||
'/label',
|
'/label',
|
||||||
'select' => array('name' => 'data[Model][user_id]', 'id' => 'ModelUserId'),
|
'select' => array('name' => 'data[Thing][user_id]', 'id' => 'ThingUserId'),
|
||||||
array('option' => array('value' => '')),
|
array('option' => array('value' => '')),
|
||||||
'Some Empty',
|
'Some Empty',
|
||||||
'/option',
|
'/option',
|
||||||
|
@ -2235,14 +2235,14 @@ class FormHelperTest extends CakeTestCase {
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$this->View->viewVars['users'] = array('value' => 'good', 'other' => 'bad');
|
$this->View->viewVars['users'] = array('value' => 'good', 'other' => 'bad');
|
||||||
$this->Form->request->data = array('Model' => array('user_id' => 'value'));
|
$this->Form->request->data = array('Thing' => array('user_id' => 'value'));
|
||||||
$result = $this->Form->input('Model.user_id', array('empty' => 'Some Empty'));
|
$result = $this->Form->input('Thing.user_id', array('empty' => 'Some Empty'));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'div' => array('class' => 'input select'),
|
'div' => array('class' => 'input select'),
|
||||||
'label' => array('for' => 'ModelUserId'),
|
'label' => array('for' => 'ThingUserId'),
|
||||||
'User',
|
'User',
|
||||||
'/label',
|
'/label',
|
||||||
'select' => array('name' => 'data[Model][user_id]', 'id' => 'ModelUserId'),
|
'select' => array('name' => 'data[Thing][user_id]', 'id' => 'ThingUserId'),
|
||||||
array('option' => array('value' => '')),
|
array('option' => array('value' => '')),
|
||||||
'Some Empty',
|
'Some Empty',
|
||||||
'/option',
|
'/option',
|
||||||
|
|
Loading…
Add table
Reference in a new issue