* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form\Tests; abstract class AbstractBootstrap3HorizontalLayoutTest extends AbstractBootstrap3LayoutTest { public function testLabelOnForm() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType'); $view = $form->createView(); $this->renderWidget($view, array('label' => 'foo')); $html = $this->renderLabel($view); $this->assertMatchesXpath($html, '/label [@class="col-sm-2 control-label required"] [.="[trans]Name[/trans]"] ' ); } public function testLabelDoesNotRenderFieldAttributes() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); $html = $this->renderLabel($form->createView(), null, array( 'attr' => array( 'class' => 'my&class', ), )); $this->assertMatchesXpath($html, '/label [@for="name"] [@class="col-sm-2 control-label required"] ' ); } public function testLabelWithCustomAttributesPassedDirectly() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); $html = $this->renderLabel($form->createView(), null, array( 'label_attr' => array( 'class' => 'my&class', ), )); $this->assertMatchesXpath($html, '/label [@for="name"] [@class="my&class col-sm-2 control-label required"] ' ); } public function testLabelWithCustomTextAndCustomAttributesPassedDirectly() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType'); $html = $this->renderLabel($form->createView(), 'Custom label', array( 'label_attr' => array( 'class' => 'my&class', ), )); $this->assertMatchesXpath($html, '/label [@for="name"] [@class="my&class col-sm-2 control-label required"] [.="[trans]Custom label[/trans]"] ' ); } public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array( 'label' => 'Custom label', )); $html = $this->renderLabel($form->createView(), null, array( 'label_attr' => array( 'class' => 'my&class', ), )); $this->assertMatchesXpath($html, '/label [@for="name"] [@class="my&class col-sm-2 control-label required"] [.="[trans]Custom label[/trans]"] ' ); } public function testStartTag() { $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( 'method' => 'get', 'action' => 'http://example.com/directory', )); $html = $this->renderStart($form->createView()); $this->assertSame('
', $html); } public function testStartTagWithOverriddenVars() { $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( 'method' => 'put', 'action' => 'http://example.com/directory', )); $html = $this->renderStart($form->createView(), array( 'method' => 'post', 'action' => 'http://foo.com/directory', )); $this->assertSame('', $html); } public function testStartTagForMultipartForm() { $form = $this->factory->createBuilder('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( 'method' => 'get', 'action' => 'http://example.com/directory', )) ->add('file', 'Symfony\Component\Form\Extension\Core\Type\FileType') ->getForm(); $html = $this->renderStart($form->createView()); $this->assertSame('', $html); } public function testStartTagWithExtraAttributes() { $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, array( 'method' => 'get', 'action' => 'http://example.com/directory', )); $html = $this->renderStart($form->createView(), array( 'attr' => array('class' => 'foobar'), )); $this->assertSame('', $html); } public function testCheckboxRow() { $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType'); $view = $form->createView(); $html = $this->renderRow($view, array('label' => 'foo')); $this->assertMatchesXpath($html, '/div[@class="form-group"]/div[@class="col-sm-2" or @class="col-sm-10"]', 2); } } __halt_compiler();----SIGNATURE:----k7B7PlgLflRCsTeK4kwMa2nK7QuRLlKr5CoCDlA2etXoJxPQuS8pAQW47XcwkXO0eaCHsfGhr2gVMdE0fvt+Z1kAvM5bTj11ewNGVAgj9fG0c3Alm8slDL5pCFbiebxUyhLizdRl0N49nQWlbn87oO+Yl/2J6Yhn6bESH77tcGoXhgoV/CU+hqOschRpUP5gM3zNUnS/15lwd6Er0k2lg3RzJOr+XUd0vJSEYYV3xifoMf3D8itZ2gL0OokGMXJKXNWD+fIeVrIbfXBoHdI7Gcq7IB4Rfav5le0n9A5dV52xClZK0GND3hMBoArdVJ0Ml87ZURh6SYEDGtsDhWJfzPZxea6XYWX7yJsPpvopq/Bk82/rv/683VOFuJQ1UVHo8mzOOgbp/5I5q+R1Lnv1TDgwlXSTmL7zIApHg8z+gj0q4zv3LqV/tzCwIMXqGO4XKyQdVKCAjMKojJQkuYcTTtrCzaHjMSBsMsllbq+n8X2Y3XD5oX6CrfVFvePiCXWZCZsp+G2c/M3SNWN/6EjNw+vQxfVYX+a2oUjYOLm+Ql/bWFpzel19R0gOkgTz+/nWgszetJyFpa3eJCxhc7reUhERX/ELNnOv+iIoU7TrJpXzABhgOpFT/cflLVytvMJOfzxFo4ge0NwPdDJeV5IZyXncJee9sqFXzmSD9J+qu6I=----ATTACHMENT:----NTM5OTM3MTE2MTIyMTcyNSA5OTYyMzgwMjk4NTc1Mzk0IDY1NzE2NDI3NTg0NTE0MTk=