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

Fixes #5796 #5808

Conversation

samsonasik
Copy link
Contributor

Fixes #5796

@weierophinney weierophinney added this to the 2.2.6 milestone Mar 3, 2014
@Ocramius Ocramius self-assigned this Mar 4, 2014
/**
* @group ZF2-5796
*/
public function testGetMessagesMultipleInvalid()
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

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.

Copy link
Member

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 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 added a commit that referenced this pull request Mar 4, 2014
weierophinney added a commit that referenced this pull request Mar 4, 2014
to test the specific behavior as reported in #5796. Test now fails before the
patch, passes afterwards.
weierophinney added a commit that referenced this pull request Mar 4, 2014
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
to test the specific behavior as reported in zendframework/zendframework#5796. Test now fails before the
patch, passes afterwards.
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

\Zend\Form\Element\Email, with multiple=true leads to “Array to string conversion”
3 participants