Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5eac83c

Browse files
committed
update tests
1 parent 867d8e9 commit 5eac83c

File tree

6 files changed

+1279
-168
lines changed

6 files changed

+1279
-168
lines changed

src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function testSingleChoice()
214214
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
215215
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
216216
'multiple' => false,
217-
'expanded' => false,
217+
'widget' => 'select',
218218
));
219219

220220
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
@@ -236,7 +236,7 @@ public function testSingleChoiceWithoutTranslation()
236236
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
237237
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
238238
'multiple' => false,
239-
'expanded' => false,
239+
'widget' => 'select',
240240
'choice_translation_domain' => false,
241241
));
242242

@@ -259,7 +259,7 @@ public function testSingleChoiceWithPlaceholderWithoutTranslation()
259259
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
260260
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
261261
'multiple' => false,
262-
'expanded' => false,
262+
'widget' => 'select',
263263
'required' => false,
264264
'translation_domain' => false,
265265
'placeholder' => 'Placeholder&Not&Translated',
@@ -286,7 +286,7 @@ public function testSingleChoiceAttributes()
286286
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
287287
'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')),
288288
'multiple' => false,
289-
'expanded' => false,
289+
'widget' => 'select',
290290
));
291291

292292
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
@@ -309,7 +309,7 @@ public function testSingleChoiceWithPreferred()
309309
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
310310
'preferred_choices' => array('&b'),
311311
'multiple' => false,
312-
'expanded' => false,
312+
'widget' => 'select',
313313
));
314314

315315
$this->assertWidgetMatchesXpath($form->createView(), array('separator' => '-- sep --', 'attr' => array('class' => 'my&class')),
@@ -333,7 +333,7 @@ public function testSingleChoiceWithPreferredAndNoSeparator()
333333
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
334334
'preferred_choices' => array('&b'),
335335
'multiple' => false,
336-
'expanded' => false,
336+
'widget' => 'select',
337337
));
338338

339339
$this->assertWidgetMatchesXpath($form->createView(), array('separator' => null, 'attr' => array('class' => 'my&class')),
@@ -356,7 +356,7 @@ public function testSingleChoiceWithPreferredAndBlankSeparator()
356356
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
357357
'preferred_choices' => array('&b'),
358358
'multiple' => false,
359-
'expanded' => false,
359+
'widget' => 'select',
360360
));
361361

362362
$this->assertWidgetMatchesXpath($form->createView(), array('separator' => '', 'attr' => array('class' => 'my&class')),
@@ -380,7 +380,7 @@ public function testChoiceWithOnlyPreferred()
380380
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
381381
'preferred_choices' => array('&a', '&b'),
382382
'multiple' => false,
383-
'expanded' => false,
383+
'widget' => 'select',
384384
));
385385

386386
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
@@ -397,7 +397,7 @@ public function testSingleChoiceNonRequired()
397397
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
398398
'required' => false,
399399
'multiple' => false,
400-
'expanded' => false,
400+
'widget' => 'select',
401401
));
402402

403403
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
@@ -421,7 +421,7 @@ public function testSingleChoiceNonRequiredNoneSelected()
421421
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
422422
'required' => false,
423423
'multiple' => false,
424-
'expanded' => false,
424+
'widget' => 'select',
425425
));
426426

427427
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
@@ -444,7 +444,7 @@ public function testSingleChoiceNonRequiredWithPlaceholder()
444444
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
445445
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
446446
'multiple' => false,
447-
'expanded' => false,
447+
'widget' => 'select',
448448
'required' => false,
449449
'placeholder' => 'Select&Anything&Not&Me',
450450
));
@@ -470,7 +470,7 @@ public function testSingleChoiceRequiredWithPlaceholder()
470470
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
471471
'required' => true,
472472
'multiple' => false,
473-
'expanded' => false,
473+
'widget' => 'select',
474474
'placeholder' => 'Test&Me',
475475
));
476476

@@ -495,7 +495,7 @@ public function testSingleChoiceRequiredWithPlaceholderViaView()
495495
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
496496
'required' => true,
497497
'multiple' => false,
498-
'expanded' => false,
498+
'widget' => 'select',
499499
));
500500

501501
$this->assertWidgetMatchesXpath($form->createView(), array('placeholder' => '', 'attr' => array('class' => 'my&class')),
@@ -521,7 +521,7 @@ public function testSingleChoiceGrouped()
521521
'Group&2' => array('Choice&C' => '&c'),
522522
),
523523
'multiple' => false,
524-
'expanded' => false,
524+
'widget' => 'select',
525525
));
526526

527527
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
@@ -550,7 +550,7 @@ public function testMultipleChoice()
550550
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
551551
'required' => true,
552552
'multiple' => true,
553-
'expanded' => false,
553+
'widget' => 'select',
554554
));
555555

556556
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
@@ -575,7 +575,7 @@ public function testMultipleChoiceAttributes()
575575
'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')),
576576
'required' => true,
577577
'multiple' => true,
578-
'expanded' => false,
578+
'widget' => 'select',
579579
));
580580

581581
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
@@ -598,7 +598,7 @@ public function testMultipleChoiceSkipsPlaceholder()
598598
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a'), array(
599599
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
600600
'multiple' => true,
601-
'expanded' => false,
601+
'widget' => 'select',
602602
'placeholder' => 'Test&Me',
603603
));
604604

@@ -622,7 +622,7 @@ public function testMultipleChoiceNonRequired()
622622
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
623623
'required' => false,
624624
'multiple' => true,
625-
'expanded' => false,
625+
'widget' => 'select',
626626
));
627627

628628
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
@@ -643,8 +643,7 @@ public function testSingleChoiceExpanded()
643643
{
644644
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
645645
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
646-
'multiple' => false,
647-
'expanded' => true,
646+
'widget' => 'radio',
648647
));
649648

650649
$this->assertWidgetMatchesXpath($form->createView(), array(),
@@ -678,8 +677,7 @@ public function testSingleChoiceExpandedWithoutTranslation()
678677
{
679678
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
680679
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
681-
'multiple' => false,
682-
'expanded' => true,
680+
'widget' => 'radio',
683681
'choice_translation_domain' => false,
684682
));
685683

@@ -715,8 +713,7 @@ public function testSingleChoiceExpandedAttributes()
715713
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
716714
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
717715
'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')),
718-
'multiple' => false,
719-
'expanded' => true,
716+
'widget' => 'radio',
720717
));
721718

722719
$this->assertWidgetMatchesXpath($form->createView(), array(),
@@ -750,8 +747,7 @@ public function testSingleChoiceExpandedWithPlaceholder()
750747
{
751748
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
752749
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
753-
'multiple' => false,
754-
'expanded' => true,
750+
'widget' => 'radio',
755751
'placeholder' => 'Test&Me',
756752
));
757753

@@ -795,8 +791,7 @@ public function testSingleChoiceExpandedWithPlaceholderWithoutTranslation()
795791
{
796792
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', array(
797793
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b'),
798-
'multiple' => false,
799-
'expanded' => true,
794+
'widget' => 'radio',
800795
'translation_domain' => false,
801796
'placeholder' => 'Placeholder&Not&Translated',
802797
));
@@ -841,8 +836,7 @@ public function testSingleChoiceExpandedWithBooleanValue()
841836
{
842837
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', true, array(
843838
'choices' => array('Choice&A' => '1', 'Choice&B' => '0'),
844-
'multiple' => false,
845-
'expanded' => true,
839+
'widget' => 'radio',
846840
));
847841

848842
$this->assertWidgetMatchesXpath($form->createView(), array(),
@@ -876,8 +870,7 @@ public function testMultipleChoiceExpanded()
876870
{
877871
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a', '&c'), array(
878872
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'),
879-
'multiple' => true,
880-
'expanded' => true,
873+
'widget' => 'checkbox',
881874
'required' => true,
882875
));
883876

@@ -921,8 +914,7 @@ public function testMultipleChoiceExpandedWithoutTranslation()
921914
{
922915
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a', '&c'), array(
923916
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'),
924-
'multiple' => true,
925-
'expanded' => true,
917+
'widget' => 'checkbox',
926918
'required' => true,
927919
'choice_translation_domain' => false,
928920
));
@@ -968,8 +960,7 @@ public function testMultipleChoiceExpandedAttributes()
968960
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', array('&a', '&c'), array(
969961
'choices' => array('Choice&A' => '&a', 'Choice&B' => '&b', 'Choice&C' => '&c'),
970962
'choice_attr' => array('Choice&B' => array('class' => 'foo&bar')),
971-
'multiple' => true,
972-
'expanded' => true,
963+
'widget' => 'checkbox',
973964
'required' => true,
974965
));
975966

src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ public function testChoiceRowWithCustomBlock()
692692
{
693693
$form = $this->factory->createNamedBuilder('name_c', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 'a', array(
694694
'choices' => array('ChoiceA' => 'a', 'ChoiceB' => 'b'),
695-
'expanded' => true,
695+
'widget' => 'radio',
696696
))
697697
->getForm();
698698

0 commit comments

Comments
 (0)