diff options
author | Bo Yang <teboring@google.com> | 2017-12-12 17:47:04 -0800 |
---|---|---|
committer | Bo Yang <teboring@google.com> | 2017-12-12 17:47:04 -0800 |
commit | fffe8d39f810d147c6db65f90ae4f71f4e0f0116 (patch) | |
tree | deef0a6a7366be4cb61613f5bac4cfceb88f265a /php/tests | |
parent | 88102eae8f86045307e9d46ad900f91158227f2b (diff) |
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')
-rw-r--r-- | php/tests/memory_leak_test.php | 8 | ||||
-rwxr-xr-x | php/tests/test.sh | 2 |
2 files changed, 5 insertions, 5 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); diff --git a/php/tests/test.sh b/php/tests/test.sh index a308a1d2..c35372d3 100755 --- a/php/tests/test.sh +++ b/php/tests/test.sh @@ -5,7 +5,7 @@ pushd ../ext/google/protobuf/ make clean || true set -e # Add following in configure for debug: --enable-debug CFLAGS='-g -O0' -phpize && ./configure CFLAGS='-g -O0 -DPROTOBUF_ENABLE_TIMESTAMP' && make +phpize && ./configure CFLAGS='-g -O0' && make popd tests=( array_test.php encode_decode_test.php generated_class_test.php generated_phpdoc_test.php map_field_test.php well_known_test.php generated_service_test.php descriptors_test.php ) |