|
|
|
@ -11,6 +11,15 @@
|
|
|
|
|
|
|
|
|
|
namespace Symfony\Component\Form\Tests;
|
|
|
|
|
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\ButtonType;
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\PercentType;
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\RadioType;
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
|
|
|
use Symfony\Component\Form\FormError;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -22,7 +31,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
{
|
|
|
|
|
public function testRow()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType');
|
|
|
|
|
$form = $this->factory->createNamed('name', TextType::class);
|
|
|
|
|
$form->addError(new FormError('[trans]Error![/trans]'));
|
|
|
|
|
$view = $form->createView();
|
|
|
|
|
$html = $this->renderRow($view);
|
|
|
|
@ -47,7 +56,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testLabelOnForm()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType');
|
|
|
|
|
$form = $this->factory->createNamed('name', DateType::class);
|
|
|
|
|
$view = $form->createView();
|
|
|
|
|
$this->renderWidget($view, array('label' => 'foo'));
|
|
|
|
|
$html = $this->renderLabel($view);
|
|
|
|
@ -62,7 +71,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testLabelDoesNotRenderFieldAttributes()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType');
|
|
|
|
|
$form = $this->factory->createNamed('name', TextType::class);
|
|
|
|
|
$html = $this->renderLabel($form->createView(), null, array(
|
|
|
|
|
'attr' => array(
|
|
|
|
|
'class' => 'my&class',
|
|
|
|
@ -79,7 +88,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testLabelWithCustomAttributesPassedDirectly()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType');
|
|
|
|
|
$form = $this->factory->createNamed('name', TextType::class);
|
|
|
|
|
$html = $this->renderLabel($form->createView(), null, array(
|
|
|
|
|
'label_attr' => array(
|
|
|
|
|
'class' => 'my&class',
|
|
|
|
@ -96,7 +105,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testLabelWithCustomTextAndCustomAttributesPassedDirectly()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType');
|
|
|
|
|
$form = $this->factory->createNamed('name', TextType::class);
|
|
|
|
|
$html = $this->renderLabel($form->createView(), 'Custom label', array(
|
|
|
|
|
'label_attr' => array(
|
|
|
|
|
'class' => 'my&class',
|
|
|
|
@ -114,7 +123,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array(
|
|
|
|
|
$form = $this->factory->createNamed('name', TextType::class, null, array(
|
|
|
|
|
'label' => 'Custom label',
|
|
|
|
|
));
|
|
|
|
|
$html = $this->renderLabel($form->createView(), null, array(
|
|
|
|
@ -134,7 +143,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testLegendOnExpandedType()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', null, array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, null, array(
|
|
|
|
|
'label' => 'Custom label',
|
|
|
|
|
'expanded' => true,
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
|
|
|
|
@ -153,7 +162,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testErrors()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType');
|
|
|
|
|
$form = $this->factory->createNamed('name', TextType::class);
|
|
|
|
|
$form->addError(new FormError('[trans]Error 1[/trans]'));
|
|
|
|
|
$form->addError(new FormError('[trans]Error 2[/trans]'));
|
|
|
|
|
$view = $form->createView();
|
|
|
|
@ -178,7 +187,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testErrorWithNoLabel()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', array('label' => false));
|
|
|
|
|
$form = $this->factory->createNamed('name', TextType::class, array('label' => false));
|
|
|
|
|
$form->addError(new FormError('[trans]Error 1[/trans]'));
|
|
|
|
|
$view = $form->createView();
|
|
|
|
|
$html = $this->renderLabel($view);
|
|
|
|
@ -188,7 +197,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testCheckedCheckbox()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', true);
|
|
|
|
|
$form = $this->factory->createNamed('name', CheckboxType::class, true);
|
|
|
|
|
|
|
|
|
|
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')),
|
|
|
|
|
'/div
|
|
|
|
@ -205,7 +214,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testSingleChoiceAttributesWithMainAttributes()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, '&a', array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
|
|
|
|
|
'multiple' => false,
|
|
|
|
|
'expanded' => false,
|
|
|
|
@ -228,7 +237,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testSingleExpandedChoiceAttributesWithMainAttributes()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, '&a', array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
|
|
|
|
|
'multiple' => false,
|
|
|
|
|
'expanded' => true,
|
|
|
|
@ -261,7 +270,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testUncheckedCheckbox()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', false);
|
|
|
|
|
$form = $this->factory->createNamed('name', CheckboxType::class, false);
|
|
|
|
|
|
|
|
|
|
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')),
|
|
|
|
|
'/div
|
|
|
|
@ -277,7 +286,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testCheckboxWithValue()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', false, array(
|
|
|
|
|
$form = $this->factory->createNamed('name', CheckboxType::class, false, array(
|
|
|
|
|
'value' => 'foo&bar',
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
@ -295,7 +304,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testSingleChoiceExpanded()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, '&a', array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
|
|
|
|
|
'multiple' => false,
|
|
|
|
|
'expanded' => true,
|
|
|
|
@ -326,7 +335,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testSingleChoiceExpandedWithLabelsAsFalse()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, '&a', array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
|
|
|
|
|
'choice_label' => false,
|
|
|
|
|
'multiple' => false,
|
|
|
|
@ -356,7 +365,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testSingleChoiceExpandedWithLabelsSetByCallable()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, '&a', array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'),
|
|
|
|
|
'choice_label' => function ($choice, $label, $value) {
|
|
|
|
|
if ('&b' === $choice) {
|
|
|
|
@ -400,7 +409,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testSingleChoiceExpandedWithLabelsSetFalseByCallable()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, '&a', array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
|
|
|
|
|
'choice_label' => function () {
|
|
|
|
|
return false;
|
|
|
|
@ -432,7 +441,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testSingleChoiceExpandedWithoutTranslation()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, '&a', array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
|
|
|
|
|
'multiple' => false,
|
|
|
|
|
'expanded' => true,
|
|
|
|
@ -464,7 +473,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testSingleChoiceExpandedAttributes()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, '&a', array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
|
|
|
|
|
'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')),
|
|
|
|
|
'multiple' => false,
|
|
|
|
@ -496,7 +505,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testSingleChoiceExpandedWithPlaceholder()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, '&a', array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
|
|
|
|
|
'multiple' => false,
|
|
|
|
|
'expanded' => true,
|
|
|
|
@ -536,7 +545,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testSingleChoiceExpandedWithPlaceholderWithoutTranslation()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, '&a', array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
|
|
|
|
|
'multiple' => false,
|
|
|
|
|
'expanded' => true,
|
|
|
|
@ -577,7 +586,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testSingleChoiceExpandedWithBooleanValue()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', true, array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, true, array(
|
|
|
|
|
'choices' => array('Choice&A' => '1', 'Choice&B' => '0'),
|
|
|
|
|
'multiple' => false,
|
|
|
|
|
'expanded' => true,
|
|
|
|
@ -608,7 +617,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testMultipleChoiceExpanded()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a', '&c'), array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, array('&a', '&c'), array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'),
|
|
|
|
|
'multiple' => true,
|
|
|
|
|
'expanded' => true,
|
|
|
|
@ -647,7 +656,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testMultipleChoiceExpandedWithLabelsAsFalse()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a'), array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, array('&a'), array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
|
|
|
|
|
'choice_label' => false,
|
|
|
|
|
'multiple' => true,
|
|
|
|
@ -677,7 +686,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testMultipleChoiceExpandedWithLabelsSetByCallable()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a'), array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, array('&a'), array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'),
|
|
|
|
|
'choice_label' => function ($choice, $label, $value) {
|
|
|
|
|
if ('&b' === $choice) {
|
|
|
|
@ -721,7 +730,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testMultipleChoiceExpandedWithLabelsSetFalseByCallable()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a'), array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, array('&a'), array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
|
|
|
|
|
'choice_label' => function () {
|
|
|
|
|
return false;
|
|
|
|
@ -753,7 +762,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testMultipleChoiceExpandedWithoutTranslation()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a', '&c'), array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, array('&a', '&c'), array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'),
|
|
|
|
|
'multiple' => true,
|
|
|
|
|
'expanded' => true,
|
|
|
|
@ -793,7 +802,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testMultipleChoiceExpandedAttributes()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a', '&c'), array(
|
|
|
|
|
$form = $this->factory->createNamed('name', ChoiceType::class, array('&a', '&c'), array(
|
|
|
|
|
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'),
|
|
|
|
|
'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')),
|
|
|
|
|
'multiple' => true,
|
|
|
|
@ -833,7 +842,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testCheckedRadio()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\RadioType', true);
|
|
|
|
|
$form = $this->factory->createNamed('name', RadioType::class, true);
|
|
|
|
|
|
|
|
|
|
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')),
|
|
|
|
|
'/div
|
|
|
|
@ -855,7 +864,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testUncheckedRadio()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\RadioType', false);
|
|
|
|
|
$form = $this->factory->createNamed('name', RadioType::class, false);
|
|
|
|
|
|
|
|
|
|
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')),
|
|
|
|
|
'/div
|
|
|
|
@ -876,7 +885,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testRadioWithValue()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\RadioType', false, array(
|
|
|
|
|
$form = $this->factory->createNamed('name', RadioType::class, false, array(
|
|
|
|
|
'value' => 'foo&bar',
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
@ -900,7 +909,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testButtonAttributeNameRepeatedIfTrue()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('button', 'Symfony\Component\Form\Extension\Core\Type\ButtonType', null, array(
|
|
|
|
|
$form = $this->factory->createNamed('button', ButtonType::class, null, array(
|
|
|
|
|
'attr' => array('foo' => true),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
@ -912,7 +921,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testFile()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\FileType');
|
|
|
|
|
$form = $this->factory->createNamed('name', FileType::class);
|
|
|
|
|
|
|
|
|
|
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class form-control-file')),
|
|
|
|
|
'/input
|
|
|
|
@ -923,7 +932,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testMoney()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\MoneyType', 1234.56, array(
|
|
|
|
|
$form = $this->factory->createNamed('name', MoneyType::class, 1234.56, array(
|
|
|
|
|
'currency' => 'EUR',
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
@ -951,7 +960,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|
|
|
|
|
|
|
|
|
public function testPercent()
|
|
|
|
|
{
|
|
|
|
|
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\PercentType', 0.1);
|
|
|
|
|
$form = $this->factory->createNamed('name', PercentType::class, 0.1);
|
|
|
|
|
|
|
|
|
|
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')),
|
|
|
|
|
'/div
|
|
|
|
|