aboutsummaryrefslogtreecommitdiff
path: root/php
diff options
context:
space:
mode:
Diffstat (limited to 'php')
-rw-r--r--php/src/Google/Protobuf/Internal/MapField.php1
-rw-r--r--php/src/Google/Protobuf/Internal/Message.php1
-rwxr-xr-xphp/tests/gdb_test.sh2
-rw-r--r--php/tests/proto/test_import_descriptor_proto.proto14
-rw-r--r--php/tests/well_known_test.php10
5 files changed, 23 insertions, 5 deletions
diff --git a/php/src/Google/Protobuf/Internal/MapField.php b/php/src/Google/Protobuf/Internal/MapField.php
index f65bd9b8..55cc12ce 100644
--- a/php/src/Google/Protobuf/Internal/MapField.php
+++ b/php/src/Google/Protobuf/Internal/MapField.php
@@ -155,7 +155,6 @@ function checkKey($key_type, &$key)
GPBUtil::checkString($key, true);
break;
default:
- var_dump($key_type);
trigger_error(
"Given type cannot be map key.",
E_USER_ERROR);
diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php
index 0fb6cdc0..887c86ca 100644
--- a/php/src/Google/Protobuf/Internal/Message.php
+++ b/php/src/Google/Protobuf/Internal/Message.php
@@ -71,7 +71,6 @@ class Message
return;
}
$pool = DescriptorPool::getGeneratedPool();
- var_dump(get_class($this));
$this->desc = $pool->getDescriptorByClassName(get_class($this));
foreach ($this->desc->getField() as $field) {
$setter = $field->getSetter();
diff --git a/php/tests/gdb_test.sh b/php/tests/gdb_test.sh
index 484e2edf..0809bef3 100755
--- a/php/tests/gdb_test.sh
+++ b/php/tests/gdb_test.sh
@@ -3,7 +3,7 @@
# gdb --args php -dextension=../ext/google/protobuf/modules/protobuf.so `which
# phpunit` --bootstrap autoload.php tmp_test.php
#
-gdb --args php -dextension=../ext/google/protobuf/modules/protobuf.so `which phpunit` --bootstrap autoload.php encode_decode_test.php
+gdb --args php -dextension=../ext/google/protobuf/modules/protobuf.so `which phpunit` --bootstrap autoload.php well_known_test.php
#
# gdb --args php -dextension=../ext/google/protobuf/modules/protobuf.so memory_leak_test.php
#
diff --git a/php/tests/proto/test_import_descriptor_proto.proto b/php/tests/proto/test_import_descriptor_proto.proto
new file mode 100644
index 00000000..2a19940d
--- /dev/null
+++ b/php/tests/proto/test_import_descriptor_proto.proto
@@ -0,0 +1,14 @@
+syntax = "proto3";
+
+import "google/protobuf/descriptor.proto";
+
+message TestImportDescriptorProto {
+ extend google.protobuf.MethodOptions {
+ int32 a = 72295727;
+ }
+}
+
+extend google.protobuf.MethodOptions {
+ int32 a = 72295728;
+}
+
diff --git a/php/tests/well_known_test.php b/php/tests/well_known_test.php
index 40ff1c8f..0c2aec13 100644
--- a/php/tests/well_known_test.php
+++ b/php/tests/well_known_test.php
@@ -4,8 +4,14 @@ use Google\Protobuf\GPBEmpty;
class WellKnownTest extends PHPUnit_Framework_TestCase {
- public function testNone() {
- $msg = new GPBEmpty();
+ public function testNone()
+ {
+ $msg = new GPBEmpty();
+ }
+
+ public function testImportDescriptorProto()
+ {
+ $msg = new TestImportDescriptorProto();
}
}