Skip to content

Commit

Permalink
Fix a few flaky/bad attribute matchers.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 22, 2014
1 parent af68f61 commit f12b272
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/Cake/Test/Case/View/Helper/FormHelperTest.php
Expand Up @@ -862,6 +862,7 @@ public function testFormSecurityMultipleSubmitButtons() {
'/div',
);
$this->assertTags($result, $expected);

$result = $this->Form->submit('Cancel', array('name' => 'cancel'));
$expected = array(
'div' => array('class' => 'submit'),
Expand Down Expand Up @@ -1844,8 +1845,8 @@ public function testMultipleInputValidation() {
'preg:/[^<]+/',
'/label',
'input' => array(
'type' => 'text', 'name' => 'preg:/[^<]+/',
'id' => 'preg:/[^<]+/', 'class' => 'form-error'
'type' => 'text', 'name', 'id',
'class' => 'form-error'
),
array('div' => array('class' => 'error-message')),
'You must have a last name',
Expand All @@ -1869,7 +1870,7 @@ public function testInput() {
'label' => array('for'),
'Balance',
'/label',
'input' => array('name', 'type' => 'number', 'id'),
'input' => array('name', 'type' => 'number', 'id', 'step'),
'/div',
);
$this->assertTags($result, $expected);
Expand Down Expand Up @@ -5698,14 +5699,14 @@ public function testCheckbox() {
$result = $this->Form->checkbox('Contact.field', array('id' => 'theID', 'value' => 'myvalue'));
$expected = array(
'input' => array('type' => 'hidden', 'class' => 'form-error', 'name' => 'data[Contact][field]', 'value' => '0', 'id' => 'theID_'),
array('input' => array('preg:/[^<]+/', 'value' => 'myvalue', 'id' => 'theID', 'checked' => 'checked', 'class' => 'form-error'))
array('input' => array('type', 'name', 'value' => 'myvalue', 'id' => 'theID', 'checked' => 'checked', 'class' => 'form-error'))
);
$this->assertTags($result, $expected);

$result = $this->Form->checkbox('Contact.field', array('value' => 'myvalue'));
$expected = array(
'input' => array('type' => 'hidden', 'class' => 'form-error', 'name' => 'data[Contact][field]', 'value' => '0', 'id' => 'ContactField_'),
array('input' => array('preg:/[^<]+/', 'value' => 'myvalue', 'id' => 'ContactField', 'checked' => 'checked', 'class' => 'form-error'))
array('input' => array('type', 'name', 'value' => 'myvalue', 'id' => 'ContactField', 'checked' => 'checked', 'class' => 'form-error'))
);
$this->assertTags($result, $expected);

Expand Down

0 comments on commit f12b272

Please sign in to comment.