Last active
August 29, 2015 14:16
-
-
Save ajgarlag/8421f924ef1f71792cb8 to your computer and use it in GitHub Desktop.
Problem with ValueObjects\DateTime\DateTime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
function it($m,$p){echo "\033[".($p?"32m✔":"31m✘")." It $m\033[0m\n"; if(!$p)register_shutdown_function(function(){die(1);});} | |
$nativeDateTime1 = new \DateTime('2015-02-23 20:30:00', new \DateTimeZone('Europe/Madrid')); | |
$nativeDateTime2 = new \DateTime('2015-02-23 20:30:00', new \DateTimeZone('Europe/London')); | |
it('should be different', $nativeDateTime1 != $nativeDateTime2); | |
$voDateTime1 = \ValueObjects\DateTime\DateTime::fromNativeDateTime($nativeDateTime1); | |
$voDateTime2 = \ValueObjects\DateTime\DateTime::fromNativeDateTime($nativeDateTime2); | |
it('should be different too', !$voDateTime1->sameValueAs($voDateTime2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment