Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixes #5648 #5883

Closed
wants to merge 1 commit into from

2 participants

@mwillbanks mwillbanks added this to the 2.2.6 milestone
@mwillbanks mwillbanks closed this pull request from a commit
Mike Willbanks Close #5883
Close #5648
64e697b
@mwillbanks mwillbanks closed this in 64e697b
@mwillbanks mwillbanks referenced this pull request from a commit
Mike Willbanks Forward port #5883 4445997
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 28, 2014
  1. @samsonasik

    Fixes #5648

    samsonasik authored
This page is out of date. Refresh to see the latest.
View
1  library/Zend/InputFilter/CollectionInputFilter.php
@@ -159,7 +159,6 @@ public function isValid()
if ($this->isRequired) {
$valid = false;
}
- return $valid;
}
if (count($this->collectionData) < $this->getCount()) {
View
25 tests/ZendTest/InputFilter/InputFilterTest.php
@@ -11,7 +11,9 @@
use PHPUnit_Framework_TestCase as TestCase;
use Zend\Filter;
+use Zend\InputFilter\CollectionInputFilter;
use Zend\InputFilter\Factory;
+use Zend\InputFilter\Input;
use Zend\InputFilter\InputFilter;
class InputFilterTest extends TestCase
@@ -43,4 +45,27 @@ public function testCanAddUsingSpecification()
$foo = $this->filter->get('foo');
$this->assertInstanceOf('Zend\InputFilter\InputInterface', $foo);
}
+
+ /**
+ * @group ZF2-5648
+ */
+ public function testCountZeroValidateInternalInputWithCollectionInputFilter()
+ {
+ $collection = new CollectionInputFilter();
+ $collection->setCount(0)
+ ->add(new Input(), 'name');
+ $this->filter->add($collection, 'people');
+
+ $data = array(
+ 'people' => array(
+ array(
+ 'name' => 'Wanderson',
+ ),
+ ),
+ );
+ $this->filter->setData($data);
+
+ $this->assertTrue($this->filter->isvalid());
+ $this->assertSame($data, $this->filter->getValues());
+ }
}
Something went wrong with that request. Please try again.