Conversation
👍 this would save us a lot of code checks |
Actually, I'd prefer if it didn't throw a hard exception at all, I don't see the need for it here as the validator would check for an empty value. Can you update the PR? |
Please update the tests as well, as they are testing for an exception thrown when no options are passed, and thus failing. |
I have a select which will be populated by javascript. Please can we get this merged asap. |
@@ -337,11 +337,9 @@ public function testRenderElementWithNoNameRaisesException() | |||
$this->helper->render($element); | |||
} | |||
|
|||
public function testRenderElementWithNoValueOptionsRaisesException() | |||
public function testRenderElementWithNoValueOptionsDoesNotRaiseException() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact the test should be removed due the almost the test of the file already test this
@Maks3w doesn't this serve as a regression test? |
@davidwindell Do a regression with this is really very very hard, it's not as simple as change a conditional operator or something. This involve throw an exception. |
@vseager can you remove the test? |
@weierophinney Travis is failing on PHP 5.3.3 but not on newer versions. Can you pass this PR? |
Add empty option to options array before checking if is empty, to allow for an empty select in cases where a user may not have added options into database require to populate field.