-
Notifications
You must be signed in to change notification settings - Fork 136
WIP Validator\Date with format 'd' return true with data 6 #33
Conversation
would be nice if zendframework/zendframework#6407 would be fixed too. $validator = new Date(['format' => 'Y-m-d']);
$this->assertFalse($validator->isValid(123)); // fails |
public function testFormatDayTwoDigits() | ||
{ | ||
$validator = new Date(['format' => 'd']); | ||
$this->assertFalse($validator->isValid("6")); |
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.
Use validator failure message as second argument of assertFalse
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.
@Maks3w the problem is the result of validation not the failure message
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.
@gianarb I know but is better if PHPUnit fail with a better description message rather true is not equal to false :)
@gianarb Test case should be part of |
Pinging @gianarb — do you have time to incorporate the feedback? |
I do it now |
format 'd' Day of the month, 2 digits with leading zeros but now Zend\Validator return inconsitent check
@gianarb Thanks. Now the question is: is this a problem with the validator, or with |
I'm still stumped by this, but now for a different reason: Are you asserting that given a format Can you clarify, please? |
I can't because I don't remember anymore sorry. |
I wrote this test because 'd' is day of week with 2 digits but for Validator\Date 6 is valid