@@ -32,15 +32,17 @@ public function basicBehaviorDataProvider()
32
32
'type ' => 'image/jpeg ' ,
33
33
];
34
34
35
+ $ falseTypeMessage = [ExcludeMimeType::FALSE_TYPE => "File has an incorrect mimetype of 'image/jpeg' " ];
36
+
35
37
return [
36
38
// Options, isValid Param, Expected value, messages
37
- ['image/gif ' , $ fileUpload , true ],
38
- ['image ' , $ fileUpload , false , [ExcludeMimeType:: FALSE_TYPE => " File has an incorrect mimetype of 'image/jpeg' " ] ],
39
- ['test/notype ' , $ fileUpload , true ],
40
- ['image/gif, image/jpeg ' , $ fileUpload , false , [ExcludeMimeType:: FALSE_TYPE => " File has an incorrect mimetype of 'image/jpeg' " ] ],
41
- [['image/vasa ' , 'image/gif ' ], $ fileUpload , true ],
42
- [['image/gif ' , 'jpeg ' ], $ fileUpload , false , [ExcludeMimeType:: FALSE_TYPE => " File has an incorrect mimetype of 'image/jpeg' " ] ],
43
- [['image/gif ' , 'gif ' ], $ fileUpload , true ],
39
+ ['image/gif ' , $ fileUpload , true , [] ],
40
+ ['image ' , $ fileUpload , false , $ falseTypeMessage ],
41
+ ['test/notype ' , $ fileUpload , true , [] ],
42
+ ['image/gif, image/jpeg ' , $ fileUpload , false , $ falseTypeMessage ],
43
+ [['image/vasa ' , 'image/gif ' ], $ fileUpload , true , [] ],
44
+ [['image/gif ' , 'jpeg ' ], $ fileUpload , false , $ falseTypeMessage ],
45
+ [['image/gif ' , 'gif ' ], $ fileUpload , true , [] ],
44
46
];
45
47
}
46
48
@@ -54,7 +56,7 @@ public function basicBehaviorDataProvider()
54
56
* @param bool $expected
55
57
* @param array $messages
56
58
*/
57
- public function testBasic ($ options , array $ isValidParam , $ expected , array $ messages = [] )
59
+ public function testBasic ($ options , array $ isValidParam , $ expected , array $ messages )
58
60
{
59
61
$ validator = new ExcludeMimeType ($ options );
60
62
$ validator ->enableHeaderCheck ();
0 commit comments