mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixed tests
This commit is contained in:
parent
4728586365
commit
708e960968
1 changed files with 27 additions and 25 deletions
|
@ -10740,10 +10740,12 @@ class FormHelperTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testInputErrorClass() {
|
public function testInputErrorClass() {
|
||||||
|
$Contact = ClassRegistry::getObject('Contact');
|
||||||
|
$Contact->validationErrors['field'] = array('Badness!');
|
||||||
|
|
||||||
$result = $this->Form->input('Contact.field', array(
|
$result = $this->Form->input('Contact.field', array(
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'div' => array('errorClass' => 'has-error'),
|
'div' => array('errorClass' => 'has-error')
|
||||||
'error' => true
|
|
||||||
));
|
));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'div' => array('class' => 'input text has-error'),
|
'div' => array('class' => 'input text has-error'),
|
||||||
|
@ -10754,44 +10756,44 @@ class FormHelperTest extends CakeTestCase {
|
||||||
'type' => 'text', 'name' => 'data[Contact][field]',
|
'type' => 'text', 'name' => 'data[Contact][field]',
|
||||||
'id' => 'ContactField', 'class' => 'form-error'
|
'id' => 'ContactField', 'class' => 'form-error'
|
||||||
),
|
),
|
||||||
|
array('div' => array('class' => 'error-message')),
|
||||||
|
'Badness!',
|
||||||
|
'/div'
|
||||||
|
);
|
||||||
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
$result = $this->Form->input('Contact.field', array(
|
||||||
|
'type' => 'text',
|
||||||
|
'error' => array('attributes' => array('class' => 'error'))
|
||||||
|
));
|
||||||
|
$expected = array(
|
||||||
|
'div' => array('class' => 'input text error'),
|
||||||
|
'label' => array('for' => 'ContactField'),
|
||||||
|
'Field',
|
||||||
|
'/label',
|
||||||
|
'input' => array(
|
||||||
|
'type' => 'text', 'name' => 'data[Contact][field]',
|
||||||
|
'id' => 'ContactField', 'class' => 'form-error'
|
||||||
|
),
|
||||||
array('div' => array('class' => 'error')),
|
array('div' => array('class' => 'error')),
|
||||||
'Badness!',
|
'Badness!',
|
||||||
'/div'
|
'/div'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$result = $this->Form->input('Contact.second', array(
|
$result = $this->Form->input('Contact.field', array(
|
||||||
'type' => 'text',
|
|
||||||
'error' => array('attributes' => array('class' => 'error'))
|
|
||||||
));
|
|
||||||
$expected = array(
|
|
||||||
'div' => array('class' => 'input text error'),
|
|
||||||
'label' => array('for' => 'ContactSecond'),
|
|
||||||
'Field',
|
|
||||||
'/label',
|
|
||||||
'input' => array(
|
|
||||||
'type' => 'text', 'name' => 'data[Contact][second]',
|
|
||||||
'id' => 'ContactSecond', 'class' => 'form-error'
|
|
||||||
),
|
|
||||||
array('div' => array('class' => 'error')),
|
|
||||||
'Badness!',
|
|
||||||
'/div'
|
|
||||||
);
|
|
||||||
$this->assertTags($result, $expected);
|
|
||||||
|
|
||||||
$result = $this->Form->input('Contact.third', array(
|
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'div' => array('errorClass' => 'has-error'),
|
'div' => array('errorClass' => 'has-error'),
|
||||||
'error' => array('attributes' => array('class' => 'form-control-feedback'))
|
'error' => array('attributes' => array('class' => 'form-control-feedback'))
|
||||||
));
|
));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'div' => array('class' => 'input text has-error'),
|
'div' => array('class' => 'input text has-error'),
|
||||||
'label' => array('for' => 'ContactThird'),
|
'label' => array('for' => 'ContactField'),
|
||||||
'Field',
|
'Field',
|
||||||
'/label',
|
'/label',
|
||||||
'input' => array(
|
'input' => array(
|
||||||
'type' => 'text', 'name' => 'data[Contact][third]',
|
'type' => 'text', 'name' => 'data[Contact][field]',
|
||||||
'id' => 'ContactThird', 'class' => 'form-error'
|
'id' => 'ContactField', 'class' => 'form-error'
|
||||||
),
|
),
|
||||||
array('div' => array('class' => 'form-control-feedback')),
|
array('div' => array('class' => 'form-control-feedback')),
|
||||||
'Badness!',
|
'Badness!',
|
||||||
|
|
Loading…
Reference in a new issue