@@ -428,37 +428,66 @@ public function testEntriesBlockPrefixes()
428428 public function testEntriesBlockPrefixesWithCustomBlockPrefix ()
429429 {
430430 $ collectionView = $ this ->factory ->createNamed ('fields ' , static ::TESTED_TYPE , ['' ], [
431+ 'allow_add ' => true ,
431432 'entry_options ' => ['block_prefix ' => 'field ' ],
432433 ])
433434 ->createView ()
434435 ;
435436
436- $ this ->assertCount (1 , $ collectionView );
437- $ this ->assertSame ([
437+ $ expectedBlockPrefixes = [
438438 'form ' ,
439439 'collection_entry ' ,
440440 'text ' ,
441441 'field ' ,
442442 '_fields_entry ' ,
443- ], $ collectionView [0 ]->vars ['block_prefixes ' ]);
443+ ];
444+
445+ $ this ->assertCount (1 , $ collectionView );
446+ $ this ->assertSame ($ expectedBlockPrefixes , $ collectionView [0 ]->vars ['block_prefixes ' ]);
447+ $ this ->assertSame ($ expectedBlockPrefixes , $ collectionView ->vars ['prototype ' ]->vars ['block_prefixes ' ]);
444448 }
445449
446450 public function testEntriesBlockPrefixesWithCustomBlockPrefixedType ()
447451 {
448452 $ collectionView = $ this ->factory ->createNamed ('fields ' , static ::TESTED_TYPE , ['' ], [
453+ 'allow_add ' => true ,
449454 'entry_type ' => BlockPrefixedFooTextType::class,
450455 ])
451456 ->createView ()
452457 ;
453458
454- $ this ->assertCount (1 , $ collectionView );
455- $ this ->assertSame ([
459+ $ expectedBlockPrefixes = [
456460 'form ' ,
457461 'collection_entry ' ,
458462 'block_prefixed_foo_text ' ,
459463 'foo ' ,
460464 '_fields_entry ' ,
461- ], $ collectionView [0 ]->vars ['block_prefixes ' ]);
465+ ];
466+
467+ $ this ->assertCount (1 , $ collectionView );
468+ $ this ->assertSame ($ expectedBlockPrefixes , $ collectionView [0 ]->vars ['block_prefixes ' ]);
469+ $ this ->assertSame ($ expectedBlockPrefixes , $ collectionView ->vars ['prototype ' ]->vars ['block_prefixes ' ]);
470+ }
471+
472+ public function testPrototypeBlockPrefixesWithCustomBlockPrefix ()
473+ {
474+ $ collectionView = $ this ->factory ->createNamed ('fields ' , static ::TESTED_TYPE , [], [
475+ 'allow_add ' => true ,
476+ 'entry_options ' => ['block_prefix ' => 'field ' ],
477+ ])
478+ ->createView ()
479+ ;
480+
481+ $ expectedBlockPrefixes = [
482+ 'form ' ,
483+ 'collection_entry ' ,
484+ 'text ' ,
485+ 'field ' ,
486+ '_fields_entry ' ,
487+ ];
488+
489+ $ this ->assertCount (0 , $ collectionView );
490+ $ this ->assertSame ($ expectedBlockPrefixes , $ collectionView ->vars ['prototype ' ]->vars ['block_prefixes ' ]);
462491 }
463492
464493 public function testSubmitNull ($ expected = null , $ norm = null , $ view = null )
0 commit comments