8000 [Validator] Extend and fix DateValidator & TimeValidator tests · peterlcole/symfony@d7c9644 · GitHub
[go: up one dir, main page]

Skip to content

Commit d7c9644

Browse files
committed
[Validator] Extend and fix DateValidator & TimeValidator tests
1 parent a74ae9d commit d7c9644

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tests/Symfony/Tests/Component/Validator/Constraints/DateValidatorTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testEmptyStringIsValid()
4040

4141
public function testDateTimeClassIsValid()
4242
{
43-
$this->validator->isValid(new \DateTime(), new Date());
43+
$this->assertTrue($this->validator->isValid(new \DateTime(), new Date()));
4444
}
4545

4646
public function testExpectsStringCompatibleType()
@@ -79,6 +79,8 @@ public function getInvalidDates()
7979
{
8080
return array(
8181
array('foobar'),
82+
array('foobar 2010-13-01'),
83+
array('2010-13-01 foobar'),
8284
array('2010-13-01'),
8385
array('2010-04-32'),
8486
array('2010-02-29'),

tests/Symfony/Tests/Component/Validator/Constraints/TimeValidatorTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testEmptyStringIsValid()
4040

4141
public function testDateTimeClassIsValid()
4242
{
43-
$this->validator->isValid(new \DateTime(), new Time());
43+
$this->assertTrue($this->validator->isValid(new \DateTime(), new Time()));
4444
}
4545

4646
public function testExpectsStringCompatibleType()
@@ -79,6 +79,8 @@ public function getInvalidTimes()
7979
{
8080
return array(
8181
array('foobar'),
82+
array('foobar 12:34:56'),
83+
array('12:34:56 foobar'),
8284
array('00:00'),
8385
array('24:00:00'),
8486
array('00:60:00'),

0 commit comments

Comments
 (0)
0