Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aeb27eb

Browse filesBrowse files
committed
merged branch stloyd/date_time_validator_tests (PR symfony#2338)
Commits ------- d7c9644 [Validator] Extend and fix DateValidator & TimeValidator tests Discussion ---------- [2.0][Validator] Extend and fix DateValidator & TimeValidator tests Bug fix: no Feature addition: no Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: -
2 parents a74ae9d + d7c9644 commit aeb27eb
Copy full SHA for aeb27eb

File tree

Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed

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

Copy file name to clipboardExpand all lines: tests/Symfony/Tests/Component/Validator/Constraints/DateValidatorTest.php
+3-1Lines 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

Copy file name to clipboardExpand all lines: tests/Symfony/Tests/Component/Validator/Constraints/TimeValidatorTest.php
+3-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.