diff options
Diffstat (limited to 'php')
21 files changed, 244 insertions, 29 deletions
diff --git a/php/README.md b/php/README.md index 967250a7..e307768d 100644 --- a/php/README.md +++ b/php/README.md @@ -17,7 +17,7 @@ generation functionality. To use PHP runtime library requires: - C extension: PHP 5.5, 5.6, or 7. -- PHP package: PHP 5.5, 5.6 or 7. +- [PHP package](http://php.net/downloads.php): PHP 5.5, 5.6 or 7. ## Installation diff --git a/php/ext/google/protobuf/def.c b/php/ext/google/protobuf/def.c index fa33830b..238a9247 100644 --- a/php/ext/google/protobuf/def.c +++ b/php/ext/google/protobuf/def.c @@ -253,7 +253,7 @@ PHP_METHOD(Descriptor, getField) { #else field_hashtable_value = field_descriptor_type->create_object(field_descriptor_type TSRMLS_CC); - --GC_REFCOUNT(field_hashtable_value); + GC_DELREF(field_hashtable_value); #endif FieldDescriptor *field_php = UNBOX_HASHTABLE_VALUE(FieldDescriptor, field_hashtable_value); @@ -264,7 +264,7 @@ PHP_METHOD(Descriptor, getField) { #if PHP_MAJOR_VERSION < 7 RETURN_ZVAL(field_hashtable_value, 1, 0); #else - ++GC_REFCOUNT(field_hashtable_value); + GC_ADDREF(field_hashtable_value); RETURN_OBJ(field_hashtable_value); #endif } @@ -492,7 +492,7 @@ PHP_METHOD(FieldDescriptor, getEnumType) { #if PHP_MAJOR_VERSION < 7 RETURN_ZVAL(desc, 1, 0); #else - ++GC_REFCOUNT(desc); + GC_ADDREF(desc); RETURN_OBJ(desc); #endif } @@ -512,7 +512,7 @@ PHP_METHOD(FieldDescriptor, getMessageType) { #if PHP_MAJOR_VERSION < 7 RETURN_ZVAL(desc, 1, 0); #else - ++GC_REFCOUNT(desc); + GC_ADDREF(desc); RETURN_OBJ(desc); #endif } @@ -585,7 +585,7 @@ PHP_METHOD(Oneof, getField) { #if PHP_MAJOR_VERSION < 7 RETURN_ZVAL(field_hashtable_value, 1, 0); #else - ++GC_REFCOUNT(field_hashtable_value); + GC_ADDREF(field_hashtable_value); RETURN_OBJ(field_hashtable_value); #endif } @@ -703,7 +703,7 @@ PHP_METHOD(DescriptorPool, getGeneratedPool) { #if PHP_MAJOR_VERSION < 7 RETURN_ZVAL(generated_pool_php, 1, 0); #else - ++GC_REFCOUNT(generated_pool_php); + GC_ADDREF(generated_pool_php); RETURN_OBJ(generated_pool_php); #endif } @@ -713,7 +713,7 @@ PHP_METHOD(InternalDescriptorPool, getGeneratedPool) { #if PHP_MAJOR_VERSION < 7 RETURN_ZVAL(internal_generated_pool_php, 1, 0); #else - ++GC_REFCOUNT(internal_generated_pool_php); + GC_ADDREF(internal_generated_pool_php); RETURN_OBJ(internal_generated_pool_php); #endif } @@ -1033,7 +1033,7 @@ PHP_METHOD(DescriptorPool, getDescriptorByClassName) { #if PHP_MAJOR_VERSION < 7 RETURN_ZVAL(desc, 1, 0); #else - ++GC_REFCOUNT(desc); + GC_ADDREF(desc); RETURN_OBJ(desc); #endif } @@ -1070,7 +1070,7 @@ PHP_METHOD(DescriptorPool, getEnumDescriptorByClassName) { #if PHP_MAJOR_VERSION < 7 RETURN_ZVAL(desc, 1, 0); #else - ++GC_REFCOUNT(desc); + GC_ADDREF(desc); RETURN_OBJ(desc); #endif } diff --git a/php/ext/google/protobuf/encode_decode.c b/php/ext/google/protobuf/encode_decode.c index 31a345b3..899b99f0 100644 --- a/php/ext/google/protobuf/encode_decode.c +++ b/php/ext/google/protobuf/encode_decode.c @@ -577,7 +577,7 @@ static void map_slot_value(upb_fieldtype_t type, const void* from, break; case UPB_TYPE_MESSAGE: *(zend_object**)to = Z_OBJ_P(*(zval**)from); - ++GC_REFCOUNT(*(zend_object**)to); + GC_ADDREF(*(zend_object**)to); break; #endif default: diff --git a/php/ext/google/protobuf/map.c b/php/ext/google/protobuf/map.c index ab8a518a..c5b500b5 100644 --- a/php/ext/google/protobuf/map.c +++ b/php/ext/google/protobuf/map.c @@ -192,7 +192,8 @@ static inline void php_proto_map_string_release(void *value) { } static inline void php_proto_map_object_release(void *value) { zend_object* object = *(zend_object**)value; - if(--GC_REFCOUNT(object) == 0) { + GC_DELREF(object); + if(GC_REFCOUNT(object) == 0) { zend_objects_store_del(object); } } @@ -302,7 +303,8 @@ static bool map_index_unset(Map *intern, const char* keyval, int length) { zval_ptr_dtor(upb_value_memory(&old_value)); #else zend_object* object = *(zend_object**)upb_value_memory(&old_value); - if(--GC_REFCOUNT(object) == 0) { + GC_DELREF(object); + if(GC_REFCOUNT(object) == 0) { zend_objects_store_del(object); } #endif diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c index 76d85ab0..0efe090d 100644 --- a/php/ext/google/protobuf/message.c +++ b/php/ext/google/protobuf/message.c @@ -223,13 +223,7 @@ static zval* message_get_property_ptr_ptr(zval* object, zval* member, int type, } static HashTable* message_get_properties(zval* object TSRMLS_DC) { - // User cannot get property directly (e.g., $a = $m->a) - zend_error(E_USER_ERROR, "Cannot access private properties."); -#if PHP_MAJOR_VERSION < 7 - return zend_std_get_properties(object TSRMLS_CC); -#else - return zend_std_get_properties(object); -#endif + return NULL; } static HashTable* message_get_gc(zval* object, CACHED_VALUE** table, @@ -871,7 +865,11 @@ PHP_PROTO_INIT_ENUMCLASS_START("Google\\Protobuf\\Field\\Cardinality", zend_declare_class_constant_long(field_cardinality_type, "CARDINALITY_REPEATED", 20, 3 TSRMLS_CC); const char *alias = "Google\\Protobuf\\Field_Cardinality"; +#if PHP_VERSION_ID < 70300 zend_register_class_alias_ex(alias, strlen(alias), field_cardinality_type TSRMLS_CC); +#else + zend_register_class_alias_ex(alias, strlen(alias), field_cardinality_type, 1); +#endif PHP_PROTO_INIT_ENUMCLASS_END // ----------------------------------------------------------------------------- @@ -926,7 +924,11 @@ PHP_PROTO_INIT_ENUMCLASS_START("Google\\Protobuf\\Field\\Kind", zend_declare_class_constant_long(field_kind_type, "TYPE_SINT64", 11, 18 TSRMLS_CC); const char *alias = "Google\\Protobuf\\Field_Kind"; +#if PHP_VERSION_ID < 70300 zend_register_class_alias_ex(alias, strlen(alias), field_kind_type TSRMLS_CC); +#else + zend_register_class_alias_ex(alias, strlen(alias), field_kind_type, 1); +#endif PHP_PROTO_INIT_ENUMCLASS_END // ----------------------------------------------------------------------------- diff --git a/php/ext/google/protobuf/protobuf.c b/php/ext/google/protobuf/protobuf.c index da00302f..19cc5efb 100644 --- a/php/ext/google/protobuf/protobuf.c +++ b/php/ext/google/protobuf/protobuf.c @@ -104,7 +104,7 @@ void add_def_obj(const void* def, PHP_PROTO_HASHTABLE_VALUE value) { #if PHP_MAJOR_VERSION < 7 Z_ADDREF_P(value); #else - ++GC_REFCOUNT(value); + GC_ADDREF(value); #endif add_to_table(upb_def_to_php_obj_map, def, value); } @@ -117,7 +117,7 @@ void add_ce_obj(const void* ce, PHP_PROTO_HASHTABLE_VALUE value) { #if PHP_MAJOR_VERSION < 7 Z_ADDREF_P(value); #else - ++GC_REFCOUNT(value); + GC_ADDREF(value); #endif add_to_table(ce_to_php_obj_map, ce, value); } @@ -134,7 +134,7 @@ void add_proto_obj(const char* proto, PHP_PROTO_HASHTABLE_VALUE value) { #if PHP_MAJOR_VERSION < 7 Z_ADDREF_P(value); #else - ++GC_REFCOUNT(value); + GC_ADDREF(value); #endif add_to_strtable(proto_to_php_obj_map, proto, strlen(proto), value); } @@ -235,7 +235,8 @@ static PHP_GSHUTDOWN_FUNCTION(protobuf) { static void php_proto_hashtable_descriptor_release(zval* value) { void* ptr = Z_PTR_P(value); zend_object* object = *(zend_object**)ptr; - if(--GC_REFCOUNT(object) == 0) { + GC_DELREF(object); + if(GC_REFCOUNT(object) == 0) { zend_objects_store_del(object); } efree(ptr); diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index 3ef4c84b..9cb36dc2 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -37,7 +37,7 @@ #include "upb.h" #define PHP_PROTOBUF_EXTNAME "protobuf" -#define PHP_PROTOBUF_VERSION "3.6.0" +#define PHP_PROTOBUF_VERSION "3.6.1" #define MAX_LENGTH_OF_INT64 20 #define SIZEOF_INT64 8 @@ -50,6 +50,11 @@ // PHP7 Wrappers // ---------------------------------------------------------------------------- +#if PHP_VERSION_ID < 70300 +#define GC_ADDREF(h) ++GC_REFCOUNT(h) +#define GC_DELREF(h) --GC_REFCOUNT(h) +#endif + #if PHP_MAJOR_VERSION < 7 #define php_proto_zend_literal const zend_literal* @@ -500,7 +505,7 @@ static inline int php_proto_zend_hash_get_current_data_ex(HashTable* ht, PHP_PROTO_HASHTABLE_VALUE WRAPPED_OBJ; \ WRAPPED_OBJ = OBJ_CLASS_ENTRY->create_object(OBJ_CLASS_ENTRY); \ OBJ = UNBOX_HASHTABLE_VALUE(OBJ_TYPE, WRAPPED_OBJ); \ - --GC_REFCOUNT(WRAPPED_OBJ); + GC_DELREF(WRAPPED_OBJ); #define PHP_PROTO_CE_DECLARE zend_class_entry* #define PHP_PROTO_CE_UNREF(ce) (ce) diff --git a/php/ext/google/protobuf/storage.c b/php/ext/google/protobuf/storage.c index e7910c85..a60fbe39 100644 --- a/php/ext/google/protobuf/storage.c +++ b/php/ext/google/protobuf/storage.c @@ -200,7 +200,7 @@ bool native_slot_set_by_array(upb_fieldtype_t type, } #else DEREF(memory, zval*) = value; - ++GC_REFCOUNT(Z_OBJ_P(value)); + GC_ADDREF(Z_OBJ_P(value)); #endif break; } @@ -251,7 +251,7 @@ bool native_slot_set_by_map(upb_fieldtype_t type, const zend_class_entry* klass, } #else DEREF(memory, zend_object*) = Z_OBJ_P(value); - ++GC_REFCOUNT(Z_OBJ_P(value)); + GC_ADDREF(Z_OBJ_P(value)); #endif break; } @@ -428,7 +428,7 @@ void native_slot_get_by_map_value(upb_fieldtype_t type, const void* memory, ZVAL_ZVAL(CACHED_PTR_TO_ZVAL_PTR(cache), value, 1, 0); } #else - ++GC_REFCOUNT(*(zend_object**)memory); + GC_ADDREF(*(zend_object**)memory); ZVAL_OBJ(cache, *(zend_object**)memory); #endif return; diff --git a/php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php b/php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php new file mode 100644 index 00000000..c928fbe5 --- /dev/null +++ b/php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/descriptor.proto + +namespace Google\Protobuf\Internal; + +if (false) { + /** + * This class is deprecated. Use Google\Protobuf\Internal\DescriptorProto\ExtensionRange instead. + * @deprecated + */ + class DescriptorProto_ExtensionRange {} +} +class_exists(DescriptorProto\ExtensionRange::class); +@trigger_error('Google\Protobuf\Internal\DescriptorProto_ExtensionRange is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\DescriptorProto\ExtensionRange instead', E_USER_DEPRECATED); + diff --git a/php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php b/php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php new file mode 100644 index 00000000..e49e945f --- /dev/null +++ b/php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/descriptor.proto + +namespace Google\Protobuf\Internal; + +if (false) { + /** + * This class is deprecated. Use Google\Protobuf\Internal\DescriptorProto\ReservedRange instead. + * @deprecated + */ + class DescriptorProto_ReservedRange {} +} +class_exists(DescriptorProto\ReservedRange::class); +@trigger_error('Google\Protobuf\Internal\DescriptorProto_ReservedRange is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\DescriptorProto\ReservedRange instead', E_USER_DEPRECATED); + diff --git a/php/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php b/php/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php new file mode 100644 index 00000000..b1b59ed9 --- /dev/null +++ b/php/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/descriptor.proto + +namespace Google\Protobuf\Internal; + +if (false) { + /** + * This class is deprecated. Use Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange instead. + * @deprecated + */ + class EnumDescriptorProto_EnumReservedRange {} +} +class_exists(EnumDescriptorProto\EnumReservedRange::class); +@trigger_error('Google\Protobuf\Internal\EnumDescriptorProto_EnumReservedRange is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange instead', E_USER_DEPRECATED); + diff --git a/php/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php b/php/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php new file mode 100644 index 00000000..218a846e --- /dev/null +++ b/php/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/descriptor.proto + +namespace Google\Protobuf\Internal; + +if (false) { + /** + * This class is deprecated. Use Google\Protobuf\Internal\FieldDescriptorProto\Label instead. + * @deprecated + */ + class FieldDescriptorProto_Label {} +} +class_exists(FieldDescriptorProto\Label::class); +@trigger_error('Google\Protobuf\Internal\FieldDescriptorProto_Label is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\FieldDescriptorProto\Label instead', E_USER_DEPRECATED); + diff --git a/php/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php b/php/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php new file mode 100644 index 00000000..fd8d449a --- /dev/null +++ b/php/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/descriptor.proto + +namespace Google\Protobuf\Internal; + +if (false) { + /** + * This class is deprecated. Use Google\Protobuf\Internal\FieldDescriptorProto\Type instead. + * @deprecated + */ + class FieldDescriptorProto_Type {} +} +class_exists(FieldDescriptorProto\Type::class); +@trigger_error('Google\Protobuf\Internal\FieldDescriptorProto_Type is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\FieldDescriptorProto\Type instead', E_USER_DEPRECATED); + diff --git a/php/src/Google/Protobuf/Internal/FieldOptions_CType.php b/php/src/Google/Protobuf/Internal/FieldOptions_CType.php new file mode 100644 index 00000000..4d18783e --- /dev/null +++ b/php/src/Google/Protobuf/Internal/FieldOptions_CType.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/descriptor.proto + +namespace Google\Protobuf\Internal; + +if (false) { + /** + * This class is deprecated. Use Google\Protobuf\Internal\FieldOptions\CType instead. + * @deprecated + */ + class FieldOptions_CType {} +} +class_exists(FieldOptions\CType::class); +@trigger_error('Google\Protobuf\Internal\FieldOptions_CType is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\FieldOptions\CType instead', E_USER_DEPRECATED); + diff --git a/php/src/Google/Protobuf/Internal/FieldOptions_JSType.php b/php/src/Google/Protobuf/Internal/FieldOptions_JSType.php new file mode 100644 index 00000000..9db07822 --- /dev/null +++ b/php/src/Google/Protobuf/Internal/FieldOptions_JSType.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/descriptor.proto + +namespace Google\Protobuf\Internal; + +if (false) { + /** + * This class is deprecated. Use Google\Protobuf\Internal\FieldOptions\JSType instead. + * @deprecated + */ + class FieldOptions_JSType {} +} +class_exists(FieldOptions\JSType::class); +@trigger_error('Google\Protobuf\Internal\FieldOptions_JSType is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\FieldOptions\JSType instead', E_USER_DEPRECATED); + diff --git a/php/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php b/php/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php new file mode 100644 index 00000000..8926e63b --- /dev/null +++ b/php/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/descriptor.proto + +namespace Google\Protobuf\Internal; + +if (false) { + /** + * This class is deprecated. Use Google\Protobuf\Internal\FileOptions\OptimizeMode instead. + * @deprecated + */ + class FileOptions_OptimizeMode {} +} +class_exists(FileOptions\OptimizeMode::class); +@trigger_error('Google\Protobuf\Internal\FileOptions_OptimizeMode is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\FileOptions\OptimizeMode instead', E_USER_DEPRECATED); + diff --git a/php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php b/php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php new file mode 100644 index 00000000..e36f1e57 --- /dev/null +++ b/php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/descriptor.proto + +namespace Google\Protobuf\Internal; + +if (false) { + /** + * This class is deprecated. Use Google\Protobuf\Internal\GeneratedCodeInfo\Annotation instead. + * @deprecated + */ + class GeneratedCodeInfo_Annotation {} +} +class_exists(GeneratedCodeInfo\Annotation::class); +@trigger_error('Google\Protobuf\Internal\GeneratedCodeInfo_Annotation is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\GeneratedCodeInfo\Annotation instead', E_USER_DEPRECATED); + diff --git a/php/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php b/php/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php new file mode 100644 index 00000000..a2913114 --- /dev/null +++ b/php/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/descriptor.proto + +namespace Google\Protobuf\Internal; + +if (false) { + /** + * This class is deprecated. Use Google\Protobuf\Internal\MethodOptions\IdempotencyLevel instead. + * @deprecated + */ + class MethodOptions_IdempotencyLevel {} +} +class_exists(MethodOptions\IdempotencyLevel::class); +@trigger_error('Google\Protobuf\Internal\MethodOptions_IdempotencyLevel is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\MethodOptions\IdempotencyLevel instead', E_USER_DEPRECATED); + diff --git a/php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php b/php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php new file mode 100644 index 00000000..1346492d --- /dev/null +++ b/php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/descriptor.proto + +namespace Google\Protobuf\Internal; + +if (false) { + /** + * This class is deprecated. Use Google\Protobuf\Internal\SourceCodeInfo\Location instead. + * @deprecated + */ + class SourceCodeInfo_Location {} +} +class_exists(SourceCodeInfo\Location::class); +@trigger_error('Google\Protobuf\Internal\SourceCodeInfo_Location is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\SourceCodeInfo\Location instead', E_USER_DEPRECATED); + diff --git a/php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php b/php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php new file mode 100644 index 00000000..9750eb01 --- /dev/null +++ b/php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/protobuf/descriptor.proto + +namespace Google\Protobuf\Internal; + +if (false) { + /** + * This class is deprecated. Use Google\Protobuf\Internal\UninterpretedOption\NamePart instead. + * @deprecated + */ + class UninterpretedOption_NamePart {} +} +class_exists(UninterpretedOption\NamePart::class); +@trigger_error('Google\Protobuf\Internal\UninterpretedOption_NamePart is deprecated and will be removed in the next major release. Use Google\Protobuf\Internal\UninterpretedOption\NamePart instead', E_USER_DEPRECATED); + diff --git a/php/tests/generated_class_test.php b/php/tests/generated_class_test.php index 9f20bddc..8bac4e5e 100644 --- a/php/tests/generated_class_test.php +++ b/php/tests/generated_class_test.php @@ -1342,4 +1342,17 @@ class GeneratedClassTest extends TestBase TestUtil::assertTestMessage($m); } + + ######################################################### + # Test message equals. + ######################################################### + + public function testMessageEquals() + { + $m = new TestMessage(); + TestUtil::setTestMessage($m); + $n = new TestMessage(); + TestUtil::setTestMessage($n); + $this->assertEquals($m, $n); + } } |