14
14
use PHPUnit \Framework \MockObject \MockObject ;
15
15
use PHPUnit \Framework \TestCase ;
16
16
use Symfony \Component \Form \ChoiceList \ArrayChoiceList ;
17
- use Symfony \Component \Form \ChoiceList \ChoiceListInterface ;
18
17
use Symfony \Component \Form \ChoiceList \Factory \CachingFactoryDecorator ;
19
18
use Symfony \Component \Form \ChoiceList \Factory \ChoiceListFactoryInterface ;
20
19
use Symfony \Component \Form \ChoiceList \Loader \ChoiceLoaderInterface ;
@@ -235,7 +234,7 @@ public function testCreateFromLoaderDifferentValueClosure()
235
234
public function testCreateViewSamePreferredChoices ()
236
235
{
237
236
$ preferred = ['a ' ];
238
- $ list = $ this -> createMock (ChoiceListInterface::class );
237
+ $ list = new ArrayChoiceList ([] );
239
238
$ view = new ChoiceListView ();
240
239
241
240
$ this ->decoratedFactory ->expects ($ this ->once ())
@@ -251,7 +250,7 @@ public function testCreateViewDifferentPreferredChoices()
251
250
{
252
251
$ preferred1 = ['a ' ];
253
252
$ preferred2 = ['b ' ];
254
- $ list = $ this -> createMock (ChoiceListInterface::class );
253
+ $ list = new ArrayChoiceList ([] );
255
254
$ view1 = new ChoiceListView ();
256
255
$ view2 = new ChoiceListView ();
257
256
@@ -270,7 +269,7 @@ public function testCreateViewDifferentPreferredChoices()
270
269
public function testCreateViewSamePreferredChoicesClosure ()
271
270
{
272
271
$ preferred = function () {};
273
- $ list = $ this -> createMock (ChoiceListInterface::class );
272
+ $ list = new ArrayChoiceList ([] );
274
273
$ view = new ChoiceListView ();
275
274
276
275
$ this ->decoratedFactory ->expects ($ this ->once ())
@@ -286,7 +285,7 @@ public function testCreateViewDifferentPreferredChoicesClosure()
286
285
{
287
286
$ preferred1 = function () {};
288
287
$ preferred2 = function () {};
289
- $ list = $ this -> createMock (ChoiceListInterface::class );
288
+ $ list = new ArrayChoiceList ([] );
290
289
$ view1 = new ChoiceListView ();
291
290
$ view2 = new ChoiceListView ();
292
291
@@ -305,7 +304,7 @@ public function testCreateViewDifferentPreferredChoicesClosure()
305
304
public function testCreateViewSameLabelClosure ()
306
305
{
307
306
$ labels = function () {};
308
- $ list = $ this -> createMock (ChoiceListInterface::class );
307
+ $ list = new ArrayChoiceList ([] );
309
308
$ view = new ChoiceListView ();
310
309
311
310
$ this ->decoratedFactory ->expects ($ this ->once ())
@@ -321,7 +320,7 @@ public function testCreateViewDifferentLabelClosure()
321
320
{
322
321
$ labels1 = function () {};
323
322
$ labels2 = function () {};
324
- $ list = $ this -> createMock (ChoiceListInterface::class );
323
+ $ list = new ArrayChoiceList ([] );
325
324
$ view1 = new ChoiceListView ();
326
325
$ view2 = new ChoiceListView ();
327
326
@@ -340,7 +339,7 @@ public function testCreateViewDifferentLabelClosure()
340
339
public function testCreateViewSameIndexClosure ()
341
340
{
342
341
$ index = function () {};
343
- $ list = $ this -> createMock (ChoiceListInterface::class );
342
+ $ list = new ArrayChoiceList ([] );
344
343
$ view = new ChoiceListView ();
345
344
346
345
$ this ->decoratedFactory ->expects ($ this ->once ())
@@ -356,7 +355,7 @@ public function testCreateViewDifferentIndexClosure()
356
355
{
357
356
$ index1 = function () {};
358
357
$ index2 = function () {};
359
- $ list = $ this -> createMock (ChoiceListInterface::class );
358
+ $ list = new ArrayChoiceList ([] );
360
359
$ view1 = new ChoiceListView ();
361
360
$ view2 = new ChoiceListView ();
362
361
@@ -375,7 +374,7 @@ public function testCreateViewDifferentIndexClosure()
375
374
public function testCreateViewSameGroupByClosure ()
376
375
{
377
376
$ groupBy = function () {};
378
- $ list = $ this -> createMock (ChoiceListInterface::class );
377
+ $ list = new ArrayChoiceList ([] );
379
378
$ view = new ChoiceListView ();
380
379
381
380
$ this ->decoratedFactory ->expects ($ this ->once ())
@@ -391,7 +390,7 @@ public function testCreateViewDifferentGroupByClosure()
391
390
{
392
391
$ groupBy1 = function () {};
393
392
$ groupBy2 = function () {};
394
- $ list = $ this -> createMock (ChoiceListInterface::class );
393
+ $ list = new ArrayChoiceList ([] );
395
394
$ view1 = new ChoiceListView ();
396
395
$ view2 = new ChoiceListView ();
397
396
@@ -410,7 +409,7 @@ public function testCreateViewDifferentGroupByClosure()
410
409
public function testCreateViewSameAttributes ()
411
410
{
412
411
$ attr = ['class ' => 'foobar ' ];
413
- $ list = $ this -> createMock (ChoiceListInterface::class );
412
+ $ list = new ArrayChoiceList ([] );
414
413
$ view = new ChoiceListView ();
415
414
416
415
$ this ->decoratedFactory ->expects ($ this ->once ())
@@ -426,7 +425,7 @@ public function testCreateViewDifferentAttributes()
426
425
{
427
426
$ attr1 = ['class ' => 'foobar1 ' ];
428
427
$ attr2 = ['class ' => 'foobar2 ' ];
429
- $ list = $ this -> createMock (ChoiceListInterface::class );
428
+ $ list = new ArrayChoiceList ([] );
430
429
$ view1 = new ChoiceListView ();
431
430
$ view2 = new ChoiceListView ();
432
431
@@ -445,7 +444,7 @@ public function testCreateViewDifferentAttributes()
445
444
public function testCreateViewSameAttributesClosure ()
446
445
{
447
446
$ attr = function () {};
448
- $ list = $ this -> createMock (ChoiceListInterface::class );
447
+ $ list = new ArrayChoiceList ([] );
449
448
$ view = new ChoiceListView ();
450
449
451
450
$ this ->decoratedFactory ->expects ($ this ->once ())
@@ -461,7 +460,7 @@ public function testCreateViewDifferentAttributesClosure()
461
460
{
462
461
$ attr1 = function () {};
463
462
$ attr2 = function () {};
464
- $ list = $ this -> createMock (ChoiceListInterface::class );
463
+ $ list = new ArrayChoiceList ([] );
465
464
$ view1 = new ChoiceListView ();
466
465
$ view2 = new ChoiceListView ();
467
466
0 commit comments