Permalink
Browse files

Fixed tests

  • Loading branch information...
mvdriel committed Mar 8, 2017
1 parent 4728586 commit 708e960968020f5df73ffb6ade7047c0e1eb4ad9
Showing with 13 additions and 11 deletions.
  1. +13 −11 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -10740,10 +10740,12 @@ public function testLastActionWithNamedString() {
* @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 @@ public function testInputErrorClass() {
'type' => 'text', 'name' => 'data[Contact][field]',
'id' => 'ContactField', 'class' => 'form-error'
),
array('div' => array('class' => 'error')),
array('div' => array('class' => 'error-message')),
'Badness!',
'/div'
);
$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'),
'label' => array('for' => 'ContactField'),
'Field',
'/label',
'input' => array(
'type' => 'text', 'name' => 'data[Contact][second]',
'id' => 'ContactSecond', 'class' => 'form-error'
'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.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!',

0 comments on commit 708e960

Please sign in to comment.