diff options
Diffstat (limited to 'php/tests')
-rw-r--r-- | php/tests/well_known_test.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/php/tests/well_known_test.php b/php/tests/well_known_test.php index 4441b13b..690ce5f5 100644 --- a/php/tests/well_known_test.php +++ b/php/tests/well_known_test.php @@ -5,6 +5,7 @@ require_once('test_util.php'); use Google\Protobuf\GPBEmpty; use Google\Protobuf\Any; +use Google\Protobuf\Duration; use Google\Protobuf\Timestamp; use Foo\TestMessage; @@ -107,4 +108,14 @@ class WellKnownTest extends TestBase { $this->assertSame(\DateTime::class, get_class($to)); $this->assertSame($from->format('U'), $to->format('U')); } + + public function testDuration() + { + $duration = new Duration(); + + $duration->setSeconds(1); + $duration->setNanos(2); + $this->assertEquals(1, $duration->getSeconds()); + $this->assertSame(2, $duration->getNanos()); + } } |