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

Commit ce463ae

Browse files
regression test for pull request #230
1 parent f092950 commit ce463ae

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/Element/CollectionTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,4 +1398,25 @@ public function testGetErrorMessagesForInvalidCollectionElements()
13981398
$this->form->getMessages()
13991399
);
14001400
}
1401+
1402+
public function testTargetElementBeingNullNotCausingAnError()
1403+
{
1404+
$form = new Form();
1405+
1406+
$form->add([
1407+
'type' => 'Zend\Form\Element\Collection',
1408+
'name' => 'fieldsets',
1409+
'options' => [
1410+
'count' => 2
1411+
]
1412+
]);
1413+
1414+
$collection = $form->get('fieldsets');
1415+
$data = [];
1416+
$data['fieldsets'] = ['red', 'green', 'blue'];
1417+
1418+
$form->populateValues($data);
1419+
1420+
$this->addToAssertionCount(1); // expect no exception being thrown
1421+
}
14011422
}

0 commit comments

Comments
 (0)