16
16
use Symfony \Component \Form \ChoiceList \ArrayChoiceList ;
17
17
use Symfony \Component \Form \ChoiceList \ChoiceList ;
18
18
use Symfony \Component \Form \ChoiceList \ChoiceListInterface ;
19
+ use Symfony \Component \Form \ChoiceList \ChoiceListInterface ;
20
+ use Symfony \Component \Form \ChoiceList \Factory \CachingFactoryDecorator ;
19
21
use Symfony \Component \Form \ChoiceList \Factory \CachingFactoryDecorator ;
22
+ use Symfony \Component \Form \ChoiceList \Factory \ChoiceListFactoryInterface ;
20
23
use Symfony \Component \Form \ChoiceList \Loader \ChoiceLoaderInterface ;
21
24
use Symfony \Component \Form \ChoiceList \View \ChoiceListView ;
22
25
use Symfony \Component \Form \FormTypeInterface ;
@@ -38,7 +41,7 @@ class CachingFactoryDecoratorTest extends TestCase
38
41
39
42
protected function setUp (): void
40
43
{
41
- $ this ->decoratedFactory = $ this ->getMockBuilder (\ Symfony \ Component \ Form \ ChoiceList \ Factory \ ChoiceListFactoryInterface::class)-> getMock ( );
44
+ $ this ->decoratedFactory = $ this ->createMock ( ChoiceListFactoryInterface::class);
42
45
$ this ->factory = new CachingFactoryDecorator ($ this ->decoratedFactory );
43
46
}
44
47
@@ -413,7 +416,7 @@ public function testCreateFromLoaderDifferentFilterClosure()
413
416
public function testCreateViewSamePreferredChoices ()
414
417
{
415
418
$ preferred = ['a ' ];
416
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
419
+ $ list = $ this ->createMock (ChoiceListInterface::class);
417
420
$ view = new ChoiceListView ();
418
421
$ view2 = new ChoiceListView ();
419
422
@@ -447,7 +450,7 @@ public function testCreateViewDifferentPreferredChoices()
447
450
{
448
451
$ preferred1 = ['a ' ];
449
452
$ preferred2 = ['b ' ];
450
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
453
+ $ list = $ this ->createMock (ChoiceListInterface::class);
451
454
$ view1 = new ChoiceListView ();
452
455
$ view2 = new ChoiceListView ();
453
456
@@ -466,7 +469,7 @@ public function testCreateViewDifferentPreferredChoices()
466
469
public function testCreateViewSamePreferredChoicesClosure ()
467
470
{
468
471
$ preferred = function () {};
469
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
472
+ $ list = $ this ->createMock (ChoiceListInterface::class);
470
473
$ view = new ChoiceListView ();
471
474
$ view2 = new ChoiceListView ();
472
475
@@ -500,7 +503,7 @@ public function testCreateViewDifferentPreferredChoicesClosure()
500
503
{
501
504
$ preferred1 = function () {};
502
505
$ preferred2 = function () {};
503
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
506
+ $ list = $ this ->createMock (ChoiceListInterface::class);
504
507
$ view1 = new ChoiceListView ();
505
508
$ view2 = new ChoiceListView ();
506
509
@@ -519,7 +522,7 @@ public function testCreateViewDifferentPreferredChoicesClosure()
519
522
public function testCreateViewSameLabelClosure ()
520
523
{
521
524
$ labels = function () {};
522
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
525
+ $ list = $ this ->createMock (ChoiceListInterface::class);
523
526
$ view = new ChoiceListView ();
524
527
$ view2 = new ChoiceListView ();
525
528
@@ -553,7 +556,7 @@ public function testCreateViewDifferentLabelClosure()
553
556
{
554
557
$ labels1 = function () {};
555
558
$ labels2 = function () {};
556
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
559
+ $ list = $ this ->createMock (ChoiceListInterface::class);
557
560
$ view1 = new ChoiceListView ();
558
561
$ view2 = new ChoiceListView ();
559
562
@@ -572,7 +575,7 @@ public function testCreateViewDifferentLabelClosure()
572
575
public function testCreateViewSameIndexClosure ()
573
576
{
574
577
$ index = function () {};
575
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
578
+ $ list = $ this ->createMock (ChoiceListInterface::class);
576
579
$ view = new ChoiceListView ();
577
580
$ view2 = new ChoiceListView ();
578
581
@@ -606,7 +609,7 @@ public function testCreateViewDifferentIndexClosure()
606
609
{
607
610
$ index1 = function () {};
608
611
$ index2 = function () {};
609
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
612
+ $ list = $ this ->createMock (ChoiceListInterface::class);
610
613
$ view1 = new ChoiceListView ();
611
614
$ view2 = new ChoiceListView ();
612
615
@@ -625,7 +628,7 @@ public function testCreateViewDifferentIndexClosure()
625
628
public function testCreateViewSameGroupByClosure ()
626
629
{
627
630
$ groupBy = function () {};
628
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
631
+ $ list = $ this ->createMock (ChoiceListInterface::class);
629
632
$ view = new ChoiceListView ();
630
633
$ view2 = new ChoiceListView ();
631
634
@@ -659,7 +662,7 @@ public function testCreateViewDifferentGroupByClosure()
659
662
{
660
663
$ groupBy1 = function () {};
661
664
$ groupBy2 = function () {};
662
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
665
+ $ list = $ this ->createMock (ChoiceListInterface::class);
663
666
$ view1 = new ChoiceListView ();
664
667
$ view2 = new ChoiceListView ();
665
668
@@ -678,7 +681,7 @@ public function testCreateViewDifferentGroupByClosure()
678
681
public function testCreateViewSameAttributes ()
679
682
{
680
683
$ attr = ['class ' => 'foobar ' ];
681
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
684
+ $ list = $ this ->createMock (ChoiceListInterface::class);
682
685
$ view = new ChoiceListView ();
683
686
$ view2 = new ChoiceListView ();
684
687
@@ -711,7 +714,7 @@ public function testCreateViewDifferentAttributes()
711
714
{
712
715
$ attr1 = ['class ' => 'foobar1 ' ];
713
716
$ attr2 = ['class ' => 'foobar2 ' ];
714
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
717
+ $ list = $ this ->createMock (ChoiceListInterface::class);
715
718
$ view1 = new ChoiceListView ();
716
719
$ view2 = new ChoiceListView ();
717
720
@@ -730,7 +733,7 @@ public function testCreateViewDifferentAttributes()
730
733
public function testCreateViewSameAttributesClosure ()
731
734
{
732
735
$ attr = function () {};
733
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
736
+ $ list = $ this ->createMock (ChoiceListInterface::class);
734
737
$ view = new ChoiceListView ();
735
738
$ view2 = new ChoiceListView ();
736
739
@@ -763,7 +766,7 @@ public function testCreateViewDifferentAttributesClosure()
763
766
{
764
767
$ attr1 = function () {};
765
768
$ attr2 = function () {};
766
- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
769
+ $ list = $ this ->createMock (ChoiceListInterface::class);
767
770
$ view1 = new ChoiceListView ();
768
771
$ view2 = new ChoiceListView ();
769
772
0 commit comments