[Zend\InputFilter\InputFilter] SetValidationGroup() VALIDATE_ALL not working recursively #5820

Closed
wants to merge 10 commits into
from

3 participants

@demichl68

According to this issue:
#5819

demichl68 added some commits Feb 12, 2014
@demichl68 demichl68 Update BaseInputFilter.php
* Deploy reset validation groups recursively for "VALIDATE_ALL"
* Error handling for existing recursive validation group deployment
6bffbcd
@demichl68 demichl68 Update InputFilterTest.php
added test for recursively resetting validation group
added test for InvalidArgumentException on setting validation group on non-inputfilter
a79065f
@demichl68 demichl68 Update BaseInputFilterTest.php
added test for recursively resetting validation group
added test for InvalidArgumentException on setting validation group on non-inputfilter
8d57552
@demichl68 demichl68 Update InputFilterTest.php c7d2c37
@demichl68

added test methods to wrong class. sorry for that ;)

@samsonasik

travis build failure, you should fix the trailing_spaces.

@demichl68 demichl68 Update BaseInputFilterTest.php
updated tests for recursive setValidationGroup to VALIDATE_ALL
7c8506b
@demichl68

updated the test, sorry for that

demichl68 added some commits Feb 12, 2014
@demichl68 demichl68 Update BaseInputFilterTest.php
removed trailing spaces
8014c05
@demichl68 demichl68 Update BaseInputFilterTest.php
-Had my added test methods added twice. 
-Checked trailing spaces
3d7ef5f
@samsonasik

you need to use php-cs-fixer to do that,

php php-cs-fixer.phar fix /path/to/file.php --fixers=trailing_spaces
@demichl68

What an odyssey! Hope its ok now ...

@Maks3w Maks3w commented on an outdated diff Feb 18, 2014
tests/ZendTest/InputFilter/BaseInputFilterTest.php
+ );
+ $filter = new InputFilter;
+ $filter->add(new Input, 'flat');
+ $deepInputFilter = new InputFilter;
+ $deepInputFilter->add(new Input, 'deep-input1');
+ $deepInputFilter->add(new Input, 'deep-input2');
+ $filter->add($deepInputFilter, 'deep');
+ $filter->setData($data);
+ $filter->setValidationGroup(array('deep' => 'deep-input1'));
+ // reset validation group
+ $filter->setValidationGroup(InputFilter::VALIDATE_ALL);
+ $this->assertEquals($data, $filter->getValues());
+ }
+
+ /**
+ * @expectedException Zend\InputFilter\Exception\InvalidArgumentException
@Maks3w
Zend Framework member
Maks3w added a line comment Feb 18, 2014

We prefer use setExpectedException just before to call the method which should throw the exception. By this way we avoid false oks if any line before throws the same exception but for a different reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@demichl68 demichl68 Update BaseInputFilterTest.php
Moved the expected exception assertion from annotation to method body
ffbc481
@weierophinney weierophinney added this to the 2.2.6 milestone Mar 3, 2014
@weierophinney weierophinney self-assigned this Mar 4, 2014
@weierophinney weierophinney added a commit that referenced this pull request Mar 4, 2014
@weierophinney weierophinney [#5820] CS fixes
- space between conditional and operator
1d2c3ea
@weierophinney weierophinney added a commit that closed this pull request Mar 4, 2014
@weierophinney weierophinney Merge branch 'hotfix/5820'
Close #5820
0ed1ec0
@weierophinney weierophinney added a commit that referenced this pull request Mar 4, 2014
@weierophinney weierophinney Merge branch 'hotfix/5820' into develop
Forward port #5820
7a82d71
@weierophinney weierophinney added a commit to zendframework/zend-inputfilter that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge pull request zendframework/zendframework#5820 from demichl68/ma…
…ster

[Zend\InputFilter\InputFilter] SetValidationGroup() VALIDATE_ALL not working recursively
1470cb6
@weierophinney weierophinney added a commit to zendframework/zend-inputfilter that referenced this pull request May 15, 2015
@weierophinney weierophinney [zendframework/zendframework#5820] CS fixes
- space between conditional and operator
aee632a
@weierophinney weierophinney added a commit to zendframework/zend-inputfilter that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/5820' 02bca09
@weierophinney weierophinney added a commit to zendframework/zend-inputfilter that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/5820' into develop 545837f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment