);
} public function testErrors() { $form =
$this->factory->
createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'
);
$form->
addError(new FormError('[trans]Error 1[/trans]'
));
$form->
addError(new FormError('[trans]Error 2[/trans]'
));
$view =
$form->
createView();
$html =
$this->
renderErrors($view);
$this->
assertMatchesXpath($html,
'/div
[@class="alert alert-danger"]
[
./ul
[@class="list-unstyled"]
[
./li
[.=" [trans]Error 1[/trans]"]
[
./span[@class="glyphicon glyphicon-exclamation-sign"]
]
/following-sibling::li
[.=" [trans]Error 2[/trans]"]
[
./span[@class="glyphicon glyphicon-exclamation-sign"]
]
]
[count(./li)=2]
]
'