8000 [HttpFoundation] adds getDate method to the ParameterBag class by maldoinc · Pull Request #19296 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpFoundation] adds getDate method to the ParameterBag class #19296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed test case to not take into account time on getDate tests
  • Loading branch information
maldoinc committed Jul 29, 2016
commit 969b4bafbed8185adee1acf537e3d61cc8b0d14b
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function testGetDate()
$this->assertEquals(0, $diff->days, '->getDate() returns a date via the format specified');
$this->assertNull($bag->getDate('d1', 'd/m/Y'), '->getDate() returns null if the format is not valid');
$this->assertNull($bag->getDate('d2', 'd/m/Y'), '->getDate() returns null if the parameter is not found');
$this->assertEquals($date, $bag->getDate('d1', 'Y-m-d', new \DateTime('2016-12-01')), '->getDate() parses the value if the key is present');
$this->assertEquals($date->format('Ymd'), $bag->getDate('d1', 'Y-m-d', new \DateTime('2016-12-01'))->format('Ymd'), '->getDate() parses the value if the key is present');

$date = $bag->getDate('iso', \DateTime::ISO8601);
$this->assertEquals(new \DateTime($isoDate), $date);
Expand Down
0