1616use Symfony \Component \Form \ChoiceList \ArrayChoiceList ;
1717use Symfony \Component \Form \ChoiceList \ChoiceList ;
1818use Symfony \Component \Form \ChoiceList \ChoiceListInterface ;
19+ use Symfony \Component \Form \ChoiceList \ChoiceListInterface ;
20+ use Symfony \Component \Form \ChoiceList \Factory \CachingFactoryDecorator ;
1921use Symfony \Component \Form \ChoiceList \Factory \CachingFactoryDecorator ;
22+ use Symfony \Component \Form \ChoiceList \Factory \ChoiceListFactoryInterface ;
2023use Symfony \Component \Form \ChoiceList \Loader \ChoiceLoaderInterface ;
2124use Symfony \Component \Form \ChoiceList \View \ChoiceListView ;
2225use Symfony \Component \Form \FormTypeInterface ;
@@ -38,7 +41,7 @@ class CachingFactoryDecoratorTest extends TestCase
3841
3942 protected function setUp (): void
4043 {
41- $ this ->decoratedFactory = $ this ->getMockBuilder (\ Symfony \ Component \ Form \ ChoiceList \ Factory \ ChoiceListFactoryInterface::class)-> getMock ( );
44+ $ this ->decoratedFactory = $ this ->createMock ( ChoiceListFactoryInterface::class);
4245 $ this ->factory = new CachingFactoryDecorator ($ this ->decoratedFactory );
4346 }
4447
@@ -413,7 +416,7 @@ public function testCreateFromLoaderDifferentFilterClosure()
413416 public function testCreateViewSamePreferredChoices ()
414417 {
415418 $ preferred = ['a ' ];
416- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
419+ $ list = $ this ->createMock (ChoiceListInterface::class);
417420 $ view = new ChoiceListView ();
418421 $ view2 = new ChoiceListView ();
419422
@@ -447,7 +450,7 @@ public function testCreateViewDifferentPreferredChoices()
447450 {
448451 $ preferred1 = ['a ' ];
449452 $ preferred2 = ['b ' ];
450- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
453+ $ list = $ this ->createMock (ChoiceListInterface::class);
451454 $ view1 = new ChoiceListView ();
452455 $ view2 = new ChoiceListView ();
453456
@@ -466,7 +469,7 @@ public function testCreateViewDifferentPreferredChoices()
466469 public function testCreateViewSamePreferredChoicesClosure ()
467470 {
468471 $ preferred = function () {};
469- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
472+ $ list = $ this ->createMock (ChoiceListInterface::class);
470473 $ view = new ChoiceListView ();
471474 $ view2 = new ChoiceListView ();
472475
@@ -500,7 +503,7 @@ public function testCreateViewDifferentPreferredChoicesClosure()
500503 {
501504 $ preferred1 = function () {};
502505 $ preferred2 = function () {};
503- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
506+ $ list = $ this ->createMock (ChoiceListInterface::class);
504507 $ view1 = new ChoiceListView ();
505508 $ view2 = new ChoiceListView ();
506509
@@ -519,7 +522,7 @@ public function testCreateViewDifferentPreferredChoicesClosure()
519522 public function testCreateViewSameLabelClosure ()
520523 {
521524 $ labels = function () {};
522- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
525+ $ list = $ this ->createMock (ChoiceListInterface::class);
523526 $ view = new ChoiceListView ();
524527 $ view2 = new ChoiceListView ();
525528
@@ -553,7 +556,7 @@ public function testCreateViewDifferentLabelClosure()
553556 {
554557 $ labels1 = function () {};
555558 $ labels2 = function () {};
556- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
559+ $ list = $ this ->createMock (ChoiceListInterface::class);
557560 $ view1 = new ChoiceListView ();
558561 $ view2 = new ChoiceListView ();
559562
@@ -572,7 +575,7 @@ public function testCreateViewDifferentLabelClosure()
572575 public function testCreateViewSameIndexClosure ()
573576 {
574577 $ index = function () {};
575- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
578+ $ list = $ this ->createMock (ChoiceListInterface::class);
576579 $ view = new ChoiceListView ();
577580 $ view2 = new ChoiceListView ();
578581
@@ -606,7 +609,7 @@ public function testCreateViewDifferentIndexClosure()
606609 {
607610 $ index1 = function () {};
608611 $ index2 = function () {};
609- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
612+ $ list = $ this ->createMock (ChoiceListInterface::class);
610613 $ view1 = new ChoiceListView ();
611614 $ view2 = new ChoiceListView ();
612615
@@ -625,7 +628,7 @@ public function testCreateViewDifferentIndexClosure()
625628 public function testCreateViewSameGroupByClosure ()
626629 {
627630 $ groupBy = function () {};
628- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
631+ $ list = $ this ->createMock (ChoiceListInterface::class);
629632 $ view = new ChoiceListView ();
630633 $ view2 = new ChoiceListView ();
631634
@@ -659,7 +662,7 @@ public function testCreateViewDifferentGroupByClosure()
659662 {
660663 $ groupBy1 = function () {};
661664 $ groupBy2 = function () {};
662- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
665+ $ list = $ this ->createMock (ChoiceListInterface::class);
663666 $ view1 = new ChoiceListView ();
664667 $ view2 = new ChoiceListView ();
665668
@@ -678,7 +681,7 @@ public function testCreateViewDifferentGroupByClosure()
678681 public function testCreateViewSameAttributes ()
679682 {
680683 $ attr = ['class ' => 'foobar ' ];
681- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
684+ $ list = $ this ->createMock (ChoiceListInterface::class);
682685 $ view = new ChoiceListView ();
683686 $ view2 = new ChoiceListView ();
684687
@@ -711,7 +714,7 @@ public function testCreateViewDifferentAttributes()
711714 {
712715 $ attr1 = ['class ' => 'foobar1 ' ];
713716 $ attr2 = ['class ' => 'foobar2 ' ];
714- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
717+ $ list = $ this ->createMock (ChoiceListInterface::class);
715718 $ view1 = new ChoiceListView ();
716719 $ view2 = new ChoiceListView ();
717720
@@ -730,7 +733,7 @@ public function testCreateViewDifferentAttributes()
730733 public function testCreateViewSameAttributesClosure ()
731734 {
732735 $ attr = function () {};
733- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
736+ $ list = $ this ->createMock (ChoiceListInterface::class);
734737 $ view = new ChoiceListView ();
735738 $ view2 = new ChoiceListView ();
736739
@@ -763,7 +766,7 @@ public function testCreateViewDifferentAttributesClosure()
763766 {
764767 $ attr1 = function () {};
765768 $ attr2 = function () {};
766- $ list = $ this ->getMockBuilder (ChoiceListInterface::class)-> getMock ( );
769+ $ list = $ this ->createMock (ChoiceListInterface::class);
767770 $ view1 = new ChoiceListView ();
768771 $ view2 = new ChoiceListView ();
769772
0 commit comments