->
add('field2', 'Symfony\Component\Form\Extension\Core\Type\RepeatedType'
) ->
add('field3', 'Symfony\Component\Form\Extension\Core\Type\TextType'
) ->
add('field4', 'Symfony\Component\Form\Extension\Core\Type\TextType'
) ->
getForm() ->
createView();
// Render field2 row -> does not implicitly call renderWidget because
// it is a repeated field!
$this->
renderRow($view['field2'
]);
// Render field3 widget
$this->
renderWidget($view['field3'
]);
// Rest should only contain field1 and field4
$html =
$this->
renderRest($view);
$this->
assertMatchesXpath($html,
'/tr
[
./td
[./label[@for="name_field1"]]
/following-sibling::td
[./input[@id="name_field1"]]
]
/following-sibling::tr
[
./td
[./label[@for="name_field4"]]
/following-sibling::td
[./input[@id="name_field4"]]
]
[count(../tr)=3]
[count(..//label)=2]
[count(..//input)=3]
/following-sibling::tr[@style="display: none"]
[./td[@colspan="2"]/input
[@type="hidden"]
[@id="name__token"]
]
'