diff options
Diffstat (limited to 'php/tests')
-rwxr-xr-x | php/tests/compatibility_test.sh | 1 | ||||
-rw-r--r-- | php/tests/memory_leak_test.php | 2 | ||||
-rw-r--r-- | php/tests/well_known_test.php | 3 |
3 files changed, 4 insertions, 2 deletions
diff --git a/php/tests/compatibility_test.sh b/php/tests/compatibility_test.sh index b377d85c..c4d6325d 100755 --- a/php/tests/compatibility_test.sh +++ b/php/tests/compatibility_test.sh @@ -124,6 +124,7 @@ sed -i.bak '/php_implementation_test.php/d' phpunit.xml sed -i.bak '/generated_phpdoc_test.php/d' phpunit.xml sed -i.bak 's/generated_phpdoc_test.php//g' tests/test.sh sed -i.bak '/memory_leak_test.php/d' tests/test.sh +sed -i.bak '/^ public function testTimestamp()$/,/^ }$/d' tests/well_known_test.php for t in "${tests[@]}" do remove_error_test tests/$t diff --git a/php/tests/memory_leak_test.php b/php/tests/memory_leak_test.php index 4e3874b7..f3bcb963 100644 --- a/php/tests/memory_leak_test.php +++ b/php/tests/memory_leak_test.php @@ -152,7 +152,7 @@ date_default_timezone_set('UTC'); $from = new DateTime('2011-01-01T15:03:01.012345UTC'); $timestamp->fromDateTime($from); assert($from->format('U') == $timestamp->getSeconds()); -assert(0 == $timestamp->getNanos()); +assert(1000 * $from->format('u') == $timestamp->getNanos()); $to = $timestamp->toDateTime(); assert(\DateTime::class == get_class($to)); diff --git a/php/tests/well_known_test.php b/php/tests/well_known_test.php index 1e8c4f42..9f2661fa 100644 --- a/php/tests/well_known_test.php +++ b/php/tests/well_known_test.php @@ -312,11 +312,12 @@ class WellKnownTest extends TestBase { $from = new DateTime('2011-01-01T15:03:01.012345UTC'); $timestamp->fromDateTime($from); $this->assertEquals($from->format('U'), $timestamp->getSeconds()); - $this->assertSame(0, $timestamp->getNanos()); + $this->assertEquals(1000 * $from->format('u'), $timestamp->getNanos()); $to = $timestamp->toDateTime(); $this->assertSame(\DateTime::class, get_class($to)); $this->assertSame($from->format('U'), $to->format('U')); + $this->assertSame($from->format('u'), $to->format('u')); } public function testType() |