aboutsummaryrefslogtreecommitdiff
path: root/php/tests/php_implementation_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'php/tests/php_implementation_test.php')
-rw-r--r--php/tests/php_implementation_test.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/php/tests/php_implementation_test.php b/php/tests/php_implementation_test.php
index ac7c13dc..46d3e5b6 100644
--- a/php/tests/php_implementation_test.php
+++ b/php/tests/php_implementation_test.php
@@ -469,6 +469,11 @@ class ImplementationTest extends TestBase
$output = new OutputStream(3);
$output->writeVarint32(16384);
$this->assertSame(hex2bin('808001'), $output->getData());
+
+ // Negative numbers are padded to be compatible with int64.
+ $output = new OutputStream(10);
+ $output->writeVarint32(-43);
+ $this->assertSame(hex2bin('D5FFFFFFFFFFFFFFFF01'), $output->getData());
}
public function testWriteVarint64()
@@ -496,13 +501,13 @@ class ImplementationTest extends TestBase
{
$m = new TestMessage();
TestUtil::setTestMessage($m);
- $this->assertSame(447, $m->byteSize());
+ $this->assertSame(472, $m->byteSize());
}
public function testPackedByteSize()
{
$m = new TestPackedMessage();
TestUtil::setTestPackedMessage($m);
- $this->assertSame(156, $m->byteSize());
+ $this->assertSame(166, $m->byteSize());
}
}