[Form] Add tests to prove that label is not rendered when is marked as false
This commit is contained in:
parent
120547c8bc
commit
d5426f0a76
@ -526,6 +526,23 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest
|
||||
);
|
||||
}
|
||||
|
||||
public function testLabelIsNotRenderedWhenSetToFalse()
|
||||
{
|
||||
$form = $this->factory->createNamed('name', 'text', null, array(
|
||||
'label' => false
|
||||
));
|
||||
$html = $this->renderRow($form->createView());
|
||||
|
||||
$this->assertMatchesXpath($html,
|
||||
'/div
|
||||
[
|
||||
./input[@id="name"]
|
||||
]
|
||||
[count(//label)=0]
|
||||
'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider themeBlockInheritanceProvider
|
||||
*/
|
||||
|
@ -39,6 +39,25 @@ abstract class AbstractTableLayoutTest extends AbstractLayoutTest
|
||||
);
|
||||
}
|
||||
|
||||
public function testLabelIsNotRenderedWhenSetToFalse()
|
||||
{
|
||||
$form = $this->factory->createNamed('name', 'text', null, array(
|
||||
'label' => false
|
||||
));
|
||||
$html = $this->renderRow($form->createView());
|
||||
|
||||
$this->assertMatchesXpath($html,
|
||||
'/tr
|
||||
[
|
||||
./td
|
||||
[count(//label)=0]
|
||||
/following-sibling::td
|
||||
[./input[@id="name"]]
|
||||
]
|
||||
'
|
||||
);
|
||||
}
|
||||
|
||||
public function testRepeatedRow()
|
||||
{
|
||||
$form = $this->factory->createNamed('name', 'repeated');
|
||||
|
Reference in New Issue
Block a user