aboutsummaryrefslogtreecommitdiff
path: root/php/tests/test_base.php
diff options
context:
space:
mode:
Diffstat (limited to 'php/tests/test_base.php')
-rw-r--r--php/tests/test_base.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/php/tests/test_base.php b/php/tests/test_base.php
index 49886050..d461f0f7 100644
--- a/php/tests/test_base.php
+++ b/php/tests/test_base.php
@@ -75,20 +75,28 @@ class TestBase extends PHPUnit_Framework_TestCase
{
$this->assertSame(0, $m->getOptionalInt32());
$this->assertSame(0, $m->getOptionalUint32());
- $this->assertSame(0, $m->getOptionalInt64());
- $this->assertSame(0, $m->getOptionalUint64());
$this->assertSame(0, $m->getOptionalSint32());
- $this->assertSame(0, $m->getOptionalSint64());
$this->assertSame(0, $m->getOptionalFixed32());
- $this->assertSame(0, $m->getOptionalFixed64());
$this->assertSame(0, $m->getOptionalSfixed32());
- $this->assertSame(0, $m->getOptionalSfixed64());
$this->assertSame(0.0, $m->getOptionalFloat());
$this->assertSame(0.0, $m->getOptionalDouble());
$this->assertSame(false, $m->getOptionalBool());
$this->assertSame('', $m->getOptionalString());
$this->assertSame('', $m->getOptionalBytes());
$this->assertNull($m->getOptionalMessage());
+ if (PHP_INT_SIZE == 4) {
+ $this->assertSame("0", $m->getOptionalInt64());
+ $this->assertSame("0", $m->getOptionalUint64());
+ $this->assertSame("0", $m->getOptionalSint64());
+ $this->assertSame("0", $m->getOptionalFixed64());
+ $this->assertSame("0", $m->getOptionalSfixed64());
+ } else {
+ $this->assertSame(0, $m->getOptionalInt64());
+ $this->assertSame(0, $m->getOptionalUint64());
+ $this->assertSame(0, $m->getOptionalSint64());
+ $this->assertSame(0, $m->getOptionalFixed64());
+ $this->assertSame(0, $m->getOptionalSfixed64());
+ }
}
// This test is to avoid the warning of no test by php unit.