File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed
Core/FieldType/EnhancedBinaryFile Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ public function testValidateWithMineTypesFromConfig()
108108 ->with ($ this ->file )
109109 ->willReturn ('text/plain ' );
110110
111- $ this ->configResolver ->expects ($ this ->any ( ))
111+ $ this ->configResolver ->expects ($ this ->exactly ( 3 ))
112112 ->method ('hasParameter ' )
113113 ->will (
114114 $ this ->returnCallback (function ($ arg ) {
Original file line number Diff line number Diff line change @@ -60,8 +60,30 @@ public function testConvertFieldValueFromFormWithFile()
6060 public function testBuildFieldCreateForm ()
6161 {
6262 $ formBuilder = $ this ->createMock (FormBuilderInterface::class);
63- $ fieldDefinition = new FieldDefinition ();
63+ $ fieldDefinition = new FieldDefinition (array (
64+ 'fieldSettings ' => array (
65+ 'allowedTypes ' => 'jpg|pdf|txt ' ,
66+ ),
67+ ));
6468 $ lang = 'eng_US ' ;
69+
70+ $ this ->configResolver ->expects ($ this ->exactly (3 ))
71+ ->method ('hasParameter ' )
72+ ->will (
73+ $ this ->returnCallback (function ($ arg ) {
74+ if ('txt.Types ' === $ arg ) {
75+ return true ;
76+ }
77+
78+ return false ;
79+ })
80+ );
81+
82+ $ this ->configResolver ->expects ($ this ->once ())
83+ ->method ('getParameter ' )
84+ ->with ('txt.Types ' , 'mime ' )
85+ ->willReturn (array ('text/plain ' ));
86+
6587 $ this ->handler ->buildFieldCreateForm ($ formBuilder , $ fieldDefinition , $ lang );
6688 }
6789}
You can’t perform that action at this time.
0 commit comments