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

Commit

Permalink
Browse files Browse the repository at this point in the history
- trailing whitespace
  • Loading branch information
weierophinney committed Oct 22, 2013
1 parent 3a360c2 commit 7ed4a71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/CollectionInputFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function isValid()
if (count($this->collectionData) < $this->getCount()) {
$valid = false;
}

if (empty($this->collectionData)) {
$this->clearValues();
$this->clearRawValues();
Expand Down
22 changes: 11 additions & 11 deletions test/CollectionInputFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,24 +391,24 @@ public function testSetRequired()
$this->filter->setIsRequired(true);
$this->assertEquals(true,$this->filter->getIsRequired());
}

public function testNestedCollectionWithEmptyChild()
{
$items_inputfilter = new BaseInputFilter();
$items_inputfilter->add(new Input(), 'id')
->add(new Input(), 'type');
$items = new CollectionInputFilter();
$items->setInputFilter($items_inputfilter);

$groups_inputfilter = new BaseInputFilter();
$groups_inputfilter->add(new Input(), 'group_class')
->add($items, 'items');
$groups = new CollectionInputFilter();
$groups->setInputFilter($groups_inputfilter);

$inputFilter = new BaseInputFilter();
$inputFilter->add($groups, 'groups');

$preFilterdata = array(
'groups' => array(
array(
Expand Down Expand Up @@ -442,7 +442,7 @@ public function testNestedCollectionWithEmptyChild()
),
),
);

$postFilterdata = array(
'groups' => array(
array(
Expand Down Expand Up @@ -477,30 +477,30 @@ public function testNestedCollectionWithEmptyChild()
),
),
);

$inputFilter->setData($preFilterdata);
$inputFilter->isValid();
$values = $inputFilter->getValues();
$this->assertEquals($postFilterdata, $values);
}

public function testNestedCollectionWithEmptyData()
{
$items_inputfilter = new BaseInputFilter();
$items_inputfilter->add(new Input(), 'id')
->add(new Input(), 'type');
$items = new CollectionInputFilter();
$items->setInputFilter($items_inputfilter);

$groups_inputfilter = new BaseInputFilter();
$groups_inputfilter->add(new Input(), 'group_class')
->add($items, 'items');
$groups = new CollectionInputFilter();
$groups->setInputFilter($groups_inputfilter);

$inputFilter = new BaseInputFilter();
$inputFilter->add($groups, 'groups');

$data = array(
'groups' => array(
array(
Expand Down Expand Up @@ -535,7 +535,7 @@ public function testNestedCollectionWithEmptyData()
),
),
);

$inputFilter->setData($data);
$inputFilter->isValid();
$values = $inputFilter->getValues();
Expand Down

0 comments on commit 7ed4a71

Please sign in to comment.