public function ConstraintViolationListTest::testIterator in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/validator/Tests/ConstraintViolationListTest.php \Symfony\Component\Validator\Tests\ConstraintViolationListTest::testIterator()
File
- vendor/
symfony/ validator/ Tests/ ConstraintViolationListTest.php, line 71
Class
Namespace
Symfony\Component\Validator\TestsCode
public function testIterator() {
$violations = array(
10 => $this
->getViolation('Error 1'),
20 => $this
->getViolation('Error 2'),
30 => $this
->getViolation('Error 3'),
);
$this->list = new ConstraintViolationList($violations);
// indices are reset upon adding -> array_values()
$this
->assertSame(array_values($violations), iterator_to_array($this->list));
}