Fixes #5796 #5808

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

samsonasik commented Feb 10, 2014

Fixes #5796

weierophinney added this to the 2.2.6 milestone Mar 3, 2014

Ocramius self-assigned this Mar 4, 2014

@Ocramius Ocramius commented on the diff Mar 4, 2014

tests/ZendTest/Validator/ExplodeTest.php
@@ -129,4 +130,25 @@ public function testSetValidatorInvalidParam()
$validator = new Explode();
$validator->setValidator('inarray');
}
+
+ /**
+ * @group ZF2-5796
+ */
+ public function testGetMessagesMultipleInvalid()
@Ocramius

Ocramius Mar 4, 2014

Member

@samsonasik the provided test doesn't seem to fail on my machine (excluding the fix).
What are the requirements for it to fail?

@samsonasik

samsonasik Mar 4, 2014

Contributor

when it called via browser, without the SORT_REGULAR option, it will cause error like described at #5796

@Ocramius

Ocramius Mar 4, 2014

Member

Yeah, but the test doesn't seem to raise this problem, @samsonasik.

@samsonasik

samsonasik Mar 4, 2014

Contributor

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.

@Ocramius

Ocramius Mar 4, 2014

Member

@satsume can you compare the validator and the values in the test with the ones you got in your form in #5796?

@weierophinney

weierophinney Mar 4, 2014

Owner

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.

@weierophinney

weierophinney Mar 4, 2014

Owner

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 to false, 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.

@weierophinney weierophinney added a commit that referenced this pull request Mar 4, 2014

@weierophinney weierophinney [#5808] Fixed test case
to test the specific behavior as reported in #5796. Test now fails before the
patch, passes afterwards.
e2d15cf

@weierophinney weierophinney added a commit that referenced this pull request Mar 4, 2014

@weierophinney weierophinney Merge branch 'hotfix/5808' into develop
Forward port #5808
b2ab4b1

@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

@weierophinney weierophinney Merge pull request zendframework/zendframework#5808 from samsonasik/f…
…ix/multiple-invalid-explodevalidator

Fixes zendframework/zendframework#5796
a446e88

@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

@weierophinney weierophinney [zendframework/zendframework#5808] Fixed test case
to test the specific behavior as reported in zendframework/zendframework#5796. Test now fails before the
patch, passes afterwards.
23c1f01

@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

@weierophinney weierophinney Merge branch 'hotfix/5808' ee0e7b9

@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015

@weierophinney weierophinney Merge branch 'hotfix/5808' into develop 89397ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment