Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Add fail test case
Browse files Browse the repository at this point in the history
  • Loading branch information
blanchonvincent committed Apr 16, 2014
1 parent 4cb4ce2 commit 08e09a3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/ZendTest/Form/Element/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,32 @@ public function testCanValidateFormWithCollectionWithoutTemplate()
$this->assertEquals(true, $this->form->isValid());
}

public function testCannotValidateFormWithCollectionWithBadColor()
{
$this->form->setData(array(
'colors' => array(
'#ffffff',
'123465'
),
'fieldsets' => array(
array(
'field' => 'oneValue',
'nested_fieldset' => array(
'anotherField' => 'anotherValue'
)
),
array(
'field' => 'twoValue',
'nested_fieldset' => array(
'anotherField' => 'anotherValue'
)
)
)
));

$this->assertEquals(false, $this->form->isValid());
}

public function testCanValidateFormWithCollectionWithTemplate()
{
$collection = $this->form->get('colors');
Expand Down

0 comments on commit 08e09a3

Please sign in to comment.