-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fixes #5796 #5808
Fixes #5796 #5808
Conversation
/** | ||
* @group ZF2-5796 | ||
*/ | ||
public function testGetMessagesMultipleInvalid() |
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.
@samsonasik the provided test doesn't seem to fail on my machine (excluding the fix).
What are the requirements for it to fail?
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.
when it called via browser, without the SORT_REGULAR option, it will cause error like described at #5796
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.
Yeah, but the test doesn't seem to raise this problem, @samsonasik.
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.
Any suggestion for it ?
Warm regards,
Abdul Malik Ikhsan
Pada 4 Mar 2014, pukul 15.04, Marco Pivetta notifications@github.com menulis:
In tests/ZendTest/Validator/ExplodeTest.php:
@@ -129,4 +130,25 @@ public function testSetValidatorInvalidParam()
$validator = new Explode();
$validator->setValidator('inarray');
}
+
- /**
\* @group ZF2-5796
*/
- public function testGetMessagesMultipleInvalid()
Yeah, but the test doesn't seem to raise this problem, @samsonasik.—
Reply to this email directly or view it on GitHub.
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.
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.
I think a valid test case will use the regex validator as done in Zend\Form\Element\Email::getEmailValidator()
. Going to try that now and see if I see a failure with that.
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.
Okay, the trick to getting a test that failed was as follows:
- Use the same validator as
Zend\Form\Element\Email
uses. - Ensure the
breakOnFirstFailure
flag is set tofalse
, which is the default value, and which is used in the above element.
Once I did that, I had a failing test case; the suggested fix in this PR makes the test pass. Will merge shortly.
to test the specific behavior as reported in #5796. Test now fails before the patch, passes afterwards.
…ix/multiple-invalid-explodevalidator Fixes zendframework/zendframework#5796
to test the specific behavior as reported in zendframework/zendframework#5796. Test now fails before the patch, passes afterwards.
Fixes #5796