-
Notifications
You must be signed in to change notification settings - Fork 136
Fix - missing messageTemplates
in ExcludeMimeType
validator
#92
Fix - missing messageTemplates
in ExcludeMimeType
validator
#92
Conversation
@@ -51,6 +51,10 @@ public function testBasic($options, $isValidParam, $expected) | |||
$validator = new ExcludeMimeType($options); | |||
$validator->enableHeaderCheck(); | |||
$this->assertEquals($expected, $validator->isValid($isValidParam)); | |||
if (!$expected) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please instead add the expected getMessages return value on the data provider.
*/ | ||
public function testBasic($options, $isValidParam, $expected) | ||
public function testBasic($options, array $isValidParam, $expected, array $messages = []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to have all possible values in the data provider for get the whole picture. Please remove the default value.
* @var array Error message templates | ||
*/ | ||
protected $messageTemplates = [ | ||
self::FALSE_TYPE => "File has an incorrect mimetype of '%type%'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think INCORRECT_TYPE it's a better name. Why FALSE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constant was defined, the same constants name are in parent class MimeType
, I've added only messages.
We can change it, maybe it is even better, but for consistency I'd prefer to keep FALSE_TYPE
...
And it's not in the scope of the issue ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. You're right.
@Maks3w Please don't forget to update the CHANGELOG when merging... (I'll do it now, so I can release this bugfix.) |
- Added entry for #92 - Added date for 2.8.1
I was waiting for add more patches to the release |
No need to wait on releases anymore! :-) My rule of thumb is that if I
|
Fix for bug reported in #90