Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf87558d

Browse files
committed
[Form] fix violation mapper tests
This takes into account the changes to the `getErrors()` in Symfony 2.5(the method rturns a `FormErrorIterator` instead of an array) as well asthe fact that non-submitted forms do not accept errors since#10567anymore.
1 parent1c79c7b commitf87558d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,12 +1552,14 @@ public function testBacktrackIfSeveralSubFormsWithSamePropertyPath()
15521552
$parent->add($child2);
15531553
$child2->add($grandChild);
15541554

1555+
$parent->submit(array());
1556+
15551557
$this->mapper->mapViolation($violation,$parent);
15561558

15571559
// The error occurred on the child of the second form with the same path
15581560
$this->assertCount(0,$parent->getErrors(),$parent->getName().' should not have an error, but has one');
15591561
$this->assertCount(0,$child1->getErrors(),$child1->getName().' should not have an error, but has one');
15601562
$this->assertCount(0,$child2->getErrors(),$child2->getName().' should not have an error, but has one');
1561-
$this->assertEquals(array($this->getFormError()),$grandChild->getErrors(),$grandChild->getName().' should have an error, but has none');
1563+
$this->assertEquals(array($this->getFormError($violation,$grandChild)),iterator_to_array($grandChild->getErrors()),$grandChild->getName().' should have an error, but has none');
15621564
}
15631565
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp