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
|
||||
*/
|
||||
public function testInputErrorClass() {
|
||||
$Contact = ClassRegistry::getObject('Contact');
|
||||
$Contact->validationErrors['field'] = array('Badness!');
|
||||
|
||||
$result = $this->Form->input('Contact.field', array(
|
||||
'type' => 'text',
|
||||
'div' => array('errorClass' => 'has-error'),
|
||||
'error' => true
|
||||
'div' => array('errorClass' => 'has-error')
|
||||
));
|
||||
$expected = array(
|
||||
'div' => array('class' => 'input text has-error'),
|
||||
|
@ -10754,44 +10756,44 @@ class FormHelperTest extends CakeTestCase {
|
|||
'type' => 'text', 'name' => 'data[Contact][field]',
|
||||
'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')),
|
||||
'Badness!',
|
||||
'/div'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
$result = $this->Form->input('Contact.second', 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(
|
||||
$result = $this->Form->input('Contact.field', array(
|
||||
'type' => 'text',
|
||||
'div' => array('errorClass' => 'has-error'),
|
||||
'error' => array('attributes' => array('class' => 'form-control-feedback'))
|
||||
));
|
||||
$expected = array(
|
||||
'div' => array('class' => 'input text has-error'),
|
||||
'label' => array('for' => 'ContactThird'),
|
||||
'label' => array('for' => 'ContactField'),
|
||||
'Field',
|
||||
'/label',
|
||||
'input' => array(
|
||||
'type' => 'text', 'name' => 'data[Contact][third]',
|
||||
'id' => 'ContactThird', 'class' => 'form-error'
|
||||
'type' => 'text', 'name' => 'data[Contact][field]',
|
||||
'id' => 'ContactField', 'class' => 'form-error'
|
||||
),
|
||||
array('div' => array('class' => 'form-control-feedback')),
|
||||
'Badness!',
|
||||
|
|
Loading…
Reference in a new issue