-
Notifications
You must be signed in to change notification settings - Fork 136
Bugfix/not empty constructor creates bad bitmap #88
Bugfix/not empty constructor creates bad bitmap #88
Conversation
The proposed changes breaks current tests. Could you review it? |
@@ -27,6 +27,33 @@ public function setUp() | |||
$this->validator = new NotEmpty(); | |||
} | |||
|
|||
public function testConstructorWithTypeArray() |
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 refactor this as a data provider.
The coverage drop is normal, less lines per file leads to a higher percent per (uncovered) line. |
$options['type'] = $detected; | ||
} | ||
if (($type = $this->calculateTypeValue($options)) != 0) { | ||
$options['type'] = $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.
It's better create a new $options array here for to discard all those old values are now represented by $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.
This would break options for AbstractValidator. I checked and it doesn't actually cause testTypeAutoDetectionHasNoSideEffect to fail, so maybe another test should be added that uses an array that has both types and AbstractValidator options? Either that or document that if the array has any non-type values it will just be treated as a normal options array.
It looks like the current constructor allows type strings to be combined with other options.
I appreciate the constructor needs more improvements.
Could you take a look to this? |
|
Fix issue #87
DateStepTest->testMoscowWinterTime started failing when I was working on this, but it fails on master now too.