Skip to content

Commit

Permalink
Debug::export check different DateTimeZones
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk committed Jul 20, 2016
1 parent 416ca17 commit 58ed7dd
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tests/Doctrine/Tests/Common/Util/DebugTest.php
Expand Up @@ -22,20 +22,26 @@ public function testExportDateTime()
$obj = new \DateTime('2010-10-10 10:10:10', new \DateTimeZone('UTC'));

$var = Debug::export($obj, 2);
$this->assertEquals('DateTime', $var->__CLASS__ );
$this->assertEquals('2010-10-10T10:10:10+00:00', $var->date );
$this->assertEquals('DateTime', $var->__CLASS__);
$this->assertEquals('2010-10-10T10:10:10+00:00', $var->date);
}

/**
* @requires PHP 5.5
*/
public function testExportDateTimeImmutable()
{
$obj = new \DateTimeImmutable('2010-10-10 10:10:10', new \DateTimeZone('UTC'));

$var = Debug::export($obj, 2);
$this->assertEquals('DateTimeImmutable', $var->__CLASS__ );
$this->assertEquals('2010-10-10T10:10:10+00:00', $var->date );
$this->assertEquals('DateTimeImmutable', $var->__CLASS__);
$this->assertEquals('2010-10-10T10:10:10+00:00', $var->date);
}

public function testExportDateTimeZone()
{
$obj = new \DateTimeImmutable('2010-10-10 12:34:56', new \DateTimeZone('Europe/Rome'));

$var = Debug::export($obj, 2);
$this->assertEquals('DateTimeImmutable', $var->__CLASS__);
$this->assertEquals('2010-10-10T12:34:56+02:00', $var->date);
}

public function testExportArrayTraversable()
Expand Down

0 comments on commit 58ed7dd

Please sign in to comment.