aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/tests/map_field_test.php
diff options
context:
space:
mode:
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
#########################################################