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

Add empty option before empty check #2837

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions library/Zend/Form/View/Helper/FormSelect.php
Expand Up @@ -78,12 +78,6 @@ public function render(ElementInterface $element)
} }


$options = $element->getValueOptions(); $options = $element->getValueOptions();
if (empty($options)) {
throw new Exception\DomainException(sprintf(
'%s requires that the element has "value_options"; none found',
__METHOD__
));
}


if (($emptyOption = $element->getEmptyOption()) !== null) { if (($emptyOption = $element->getEmptyOption()) !== null) {
$options = array('' => $emptyOption) + $options; $options = array('' => $emptyOption) + $options;
Expand Down
8 changes: 0 additions & 8 deletions tests/ZendTest/Form/View/Helper/FormSelectTest.php
Expand Up @@ -336,12 +336,4 @@ public function testRenderElementWithNoNameRaisesException()
$this->setExpectedException('Zend\Form\Exception\DomainException'); $this->setExpectedException('Zend\Form\Exception\DomainException');
$this->helper->render($element); $this->helper->render($element);
} }

public function testRenderElementWithNoValueOptionsRaisesException()
{
$element = new SelectElement('foo');

$this->setExpectedException('Zend\Form\Exception\DomainException');
$this->helper->render($element);
}
} }