diff options
Diffstat (limited to 'php/tests/well_known_test.php')
-rw-r--r-- | php/tests/well_known_test.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/php/tests/well_known_test.php b/php/tests/well_known_test.php index 1e8c4f42..6a788df2 100644 --- a/php/tests/well_known_test.php +++ b/php/tests/well_known_test.php @@ -42,6 +42,7 @@ class WellKnownTest extends TestBase { public function testEmpty() { $msg = new GPBEmpty(); + $this->assertTrue($msg instanceof \Google\Protobuf\Internal\Message); } public function testImportDescriptorProto() @@ -312,11 +313,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() |