aboutsummaryrefslogtreecommitdiff
path: root/php/tests/map_field_test.php
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2017-04-19 16:23:51 -0700
committerGitHub <noreply@github.com>2017-04-19 16:23:51 -0700
commit190b5270c8717ca343db42da489e5e7d6d9efb2c (patch)
tree3815f20268bc56aac88267004149f9e4eb634223 /php/tests/map_field_test.php
parent43234828da6ae3a3a3ada25d11488fdfd080b79c (diff)
downloadprotobuf-190b5270c8717ca343db42da489e5e7d6d9efb2c.tar.gz
protobuf-190b5270c8717ca343db42da489e5e7d6d9efb2c.tar.bz2
protobuf-190b5270c8717ca343db42da489e5e7d6d9efb2c.zip
Make PHP c extension work with PHP7 (#2951)
Diffstat (limited to 'php/tests/map_field_test.php')
-rw-r--r--php/tests/map_field_test.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/php/tests/map_field_test.php b/php/tests/map_field_test.php
index d4ec44fc..2fda9135 100644
--- a/php/tests/map_field_test.php
+++ b/php/tests/map_field_test.php
@@ -616,11 +616,7 @@ class MapFieldTest extends PHPUnit_Framework_TestCase {
$arr[0] = $sub_m;
$this->assertSame(1, $arr[0]->getA());
- $null = NULL;
- $arr[1] = $null;
- $this->assertNull($arr[1]);
-
- $this->assertEquals(2, count($arr));
+ $this->assertEquals(1, count($arr));
}
/**
@@ -653,6 +649,17 @@ class MapFieldTest extends PHPUnit_Framework_TestCase {
$arr[0] = new TestMessage_Sub();
}
+ /**
+ * @expectedException PHPUnit_Framework_Error
+ */
+ public function testMessageSetNullFail()
+ {
+ $arr =
+ new MapField(GPBType::INT32, GPBType::MESSAGE, TestMessage::class);
+ $null = NULL;
+ $arr[0] = $null;
+ }
+
#########################################################
# Test memory leak
#########################################################