Skip to content

Commit

Permalink
minor #24752 [VarDumper] Fix DST bug (maidmaid)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] Fix DST bug

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #24749
| License       | MIT
| Doc PR        | /

Commits
-------

e375e9a Fix DST
  • Loading branch information
fabpot committed Oct 30, 2017
2 parents b327a7c + e375e9a commit 344e4b0
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/Symfony/Component/VarDumper/Tests/Caster/DateCasterTest.php
Expand Up @@ -187,10 +187,10 @@ public function provideIntervals()
return array(
array('PT0S', 0, 0, '0s', '0s'),
array('PT0S', 0.1, 0, $withMs ? '+ 00:00:00.100' : '0s', '%is'),
array('PT1S', 0, 0, '+ 00:00:01'.$ms, '1s'),
array('PT2M', 0, 0, '+ 00:02:00'.$ms, '120s'),
array('PT3H', 0, 0, '+ 03:00:00'.$ms, '10 800s'),
array('P4D', 0, 0, '+ 4d', '34%x %x00s'), // %x to account for DST
array('PT1S', 0, 0, '+ 00:00:01'.$ms, '%is'),
array('PT2M', 0, 0, '+ 00:02:00'.$ms, '%is'),
array('PT3H', 0, 0, '+ 03:00:00'.$ms, '%ss'),
array('P4D', 0, 0, '+ 4d', '%ss'),
array('P5M', 0, 0, '+ 5m', null),
array('P6Y', 0, 0, '+ 6y', null),
array('P1Y2M3DT4H5M6S', 0, 0, '+ 1y 2m 3d 04:05:06'.$ms, null),
Expand All @@ -201,10 +201,10 @@ public function provideIntervals()

array('PT0S', 0, 1, '0s', '0s'),
array('PT0S', 0.1, 1, $withMs ? '- 00:00:00.100' : '0s', '%is'),
array('PT1S', 0, 1, '- 00:00:01'.$ms, '-1s'),
array('PT2M', 0, 1, '- 00:02:00'.$ms, '-120s'),
array('PT3H', 0, 1, '- 03:00:00'.$ms, '-10 800s'),
array('P4D', 0, 1, '- 4d', '-345 600s'),
array('PT1S', 0, 1, '- 00:00:01'.$ms, '%is'),
array('PT2M', 0, 1, '- 00:02:00'.$ms, '%is'),
array('PT3H', 0, 1, '- 03:00:00'.$ms, '%ss'),
array('P4D', 0, 1, '- 4d', '%ss'),
array('P5M', 0, 1, '- 5m', null),
array('P6Y', 0, 1, '- 6y', null),
array('P1Y2M3DT4H5M6S', 0, 1, '- 1y 2m 3d 04:05:06'.$ms, null),
Expand Down Expand Up @@ -252,7 +252,7 @@ public function testDumpTimeZoneExcludingVerbosity($timezone, $expected)
}
EODUMP;

$this->assertDumpEquals($xDump, $timezone, Caster::EXCLUDE_VERBOSE);
$this->assertDumpMatchesFormat($xDump, $timezone, Caster::EXCLUDE_VERBOSE);
}

/**
Expand All @@ -275,7 +275,7 @@ public function testCastTimeZone($timezone, $xTimezone, $xRegion)
]
EODUMP;

$this->assertDumpEquals($xDump, $cast);
$this->assertDumpMatchesFormat($xDump, $cast);

$xDump = <<<EODUMP
Symfony\Component\VarDumper\Caster\ConstStub {
Expand Down Expand Up @@ -310,13 +310,13 @@ public function provideTimeZones()
array('z', '+00:00', ''),

// type 3 (timezone identifier)
array('Africa/Tunis', 'Africa/Tunis (+01:00)', $xRegion),
array('America/Panama', 'America/Panama (-05:00)', $xRegion),
array('Asia/Jerusalem', 'Asia/Jerusalem (+03:00)', $xRegion),
array('Atlantic/Canary', 'Atlantic/Canary (+01:00)', $xRegion),
array('Australia/Perth', 'Australia/Perth (+08:00)', $xRegion),
array('Europe/Zurich', 'Europe/Zurich (+02:00)', $xRegion),
array('Pacific/Tahiti', 'Pacific/Tahiti (-10:00)', $xRegion),
array('Africa/Tunis', 'Africa/Tunis (%s:00)', $xRegion),
array('America/Panama', 'America/Panama (%s:00)', $xRegion),
array('Asia/Jerusalem', 'Asia/Jerusalem (%s:00)', $xRegion),
array('Atlantic/Canary', 'Atlantic/Canary (%s:00)', $xRegion),
array('Australia/Perth', 'Australia/Perth (%s:00)', $xRegion),
array('Europe/Zurich', 'Europe/Zurich (%s:00)', $xRegion),
array('Pacific/Tahiti', 'Pacific/Tahiti (%s:00)', $xRegion),
);
}

Expand Down

0 comments on commit 344e4b0

Please sign in to comment.