aboutsummaryrefslogtreecommitdiff
path: root/php/tests/memory_leak_test.php
diff options
context:
space:
mode:
authorBo Yang <teboring@google.com>2017-12-12 17:47:04 -0800
committerBo Yang <teboring@google.com>2017-12-12 17:47:04 -0800
commitfffe8d39f810d147c6db65f90ae4f71f4e0f0116 (patch)
treedeef0a6a7366be4cb61613f5bac4cfceb88f265a /php/tests/memory_leak_test.php
parent88102eae8f86045307e9d46ad900f91158227f2b (diff)
downloadprotobuf-fffe8d39f810d147c6db65f90ae4f71f4e0f0116.tar.gz
protobuf-fffe8d39f810d147c6db65f90ae4f71f4e0f0116.tar.bz2
protobuf-fffe8d39f810d147c6db65f90ae4f71f4e0f0116.zip
Call php method via function name instead of calling directly.
This changes the linking error if php extension is not statically linked to a runtime error. In this way, users who don't need Timestamp can still use protobuf even if date extension is not statically linked in php.
Diffstat (limited to 'php/tests/memory_leak_test.php')
-rw-r--r--php/tests/memory_leak_test.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/php/tests/memory_leak_test.php b/php/tests/memory_leak_test.php
index ce268838..507635e7 100644
--- a/php/tests/memory_leak_test.php
+++ b/php/tests/memory_leak_test.php
@@ -131,12 +131,12 @@ $timestamp = new \Google\Protobuf\Timestamp();
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($from->format('U') == $timestamp->getSeconds());
+assert(0 == $timestamp->getNanos());
$to = $timestamp->toDateTime();
-assert(\DateTime::class, get_class($to));
-assert($from->format('U'), $to->format('U'));
+assert(\DateTime::class == get_class($to));
+assert($from->format('U') == $to->format('U'));
$from = new \Google\Protobuf\Value();
$from->setNumberValue(1);