From: Steve Seear Date: Wed, 19 Mar 2008 17:56:08 +0000 (+0000) Subject: Added some class tests; Replaced some hardcoded instance ids with %d. X-Git-Tag: RELEASE_2_0_0a1~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07fb7b6377ff4e745500b7dbb4adee58f103b39b;p=php Added some class tests; Replaced some hardcoded instance ids with %d. --- diff --git a/tests/classes/array_access_009.phpt b/tests/classes/array_access_009.phpt index 681fc7a8cd..00ab8b149b 100755 --- a/tests/classes/array_access_009.phpt +++ b/tests/classes/array_access_009.phpt @@ -129,9 +129,9 @@ string(6) "FooBar" string(9) "FooBarBaz" ===ArrayOverloading=== ArrayProxy::__construct(0) -object(ArrayProxy)#1 (2) { +object(ArrayProxy)#%d (2) { ["object":"ArrayProxy":private]=> - object(Peoples)#2 (1) { + object(Peoples)#%d (1) { ["person"]=> array(1) { [0]=> @@ -166,9 +166,9 @@ string(12) "FooBarBarBaz" ArrayProxy::__construct(0) ArrayProxy::offsetUnset(0, name) ArrayProxy::__construct(0) -object(ArrayProxy)#1 (2) { +object(ArrayProxy)#%d (2) { ["object":"ArrayProxy":private]=> - object(Peoples)#2 (1) { + object(Peoples)#%d (1) { ["person"]=> array(1) { [0]=> @@ -194,9 +194,9 @@ unicode(6) "FooBar" unicode(9) "FooBarBaz" ===ArrayOverloading=== ArrayProxy::__construct(0) -object(ArrayProxy)#1 (2) { +object(ArrayProxy)#%d (2) { [u"object":u"ArrayProxy":private]=> - object(Peoples)#2 (1) { + object(Peoples)#%d (1) { [u"person"]=> array(1) { [0]=> @@ -231,9 +231,9 @@ unicode(12) "FooBarBarBaz" ArrayProxy::__construct(0) ArrayProxy::offsetUnset(0, name) ArrayProxy::__construct(0) -object(ArrayProxy)#1 (2) { +object(ArrayProxy)#%d (2) { [u"object":u"ArrayProxy":private]=> - object(Peoples)#2 (1) { + object(Peoples)#%d (1) { [u"person"]=> array(1) { [0]=> diff --git a/tests/classes/array_access_010.phpt b/tests/classes/array_access_010.phpt index f254870b15..3e6828dbd3 100755 --- a/tests/classes/array_access_010.phpt +++ b/tests/classes/array_access_010.phpt @@ -105,9 +105,9 @@ string(9) "FooBarBaz" Notice: Array to string conversion in %s on line %d ArrayReferenceProxy::__construct(Array) -object(ArrayReferenceProxy)#1 (2) { +object(ArrayReferenceProxy)#%d (2) { ["object":"ArrayReferenceProxy":private]=> - object(Peoples)#2 (1) { + object(Peoples)#%d (1) { ["person"]=> array(1) { [0]=> @@ -181,9 +181,9 @@ ArrayReferenceProxy::offsetUnset(Array, name) Notice: Array to string conversion in %s on line %d ArrayReferenceProxy::__construct(Array) -object(ArrayReferenceProxy)#1 (2) { +object(ArrayReferenceProxy)#%d (2) { ["object":"ArrayReferenceProxy":private]=> - object(Peoples)#2 (1) { + object(Peoples)#%d (1) { ["person"]=> array(1) { [0]=> @@ -224,9 +224,9 @@ unicode(9) "FooBarBaz" Notice: Array to string conversion in %s on line %d ArrayReferenceProxy::__construct(Array) -object(ArrayReferenceProxy)#1 (2) { +object(ArrayReferenceProxy)#%d (2) { [u"object":u"ArrayReferenceProxy":private]=> - object(Peoples)#2 (1) { + object(Peoples)#%d (1) { [u"person"]=> array(1) { [0]=> @@ -300,9 +300,9 @@ ArrayReferenceProxy::offsetUnset(Array, name) Notice: Array to string conversion in %s on line %d ArrayReferenceProxy::__construct(Array) -object(ArrayReferenceProxy)#1 (2) { +object(ArrayReferenceProxy)#%d (2) { [u"object":u"ArrayReferenceProxy":private]=> - object(Peoples)#2 (1) { + object(Peoples)#%d (1) { [u"person"]=> array(1) { [0]=> diff --git a/tests/classes/array_access_011.phpt b/tests/classes/array_access_011.phpt index 393814cd2e..8306d6cdeb 100755 --- a/tests/classes/array_access_011.phpt +++ b/tests/classes/array_access_011.phpt @@ -112,9 +112,9 @@ string(6) "FooBar" string(9) "FooBarBaz" ===ArrayOverloading=== ArrayAccessReferenceProxy::__construct(0) -object(ArrayAccessReferenceProxy)#1 (3) { +object(ArrayAccessReferenceProxy)#%d (3) { ["object":"ArrayAccessReferenceProxy":private]=> - object(Peoples)#2 (1) { + object(Peoples)#%d (1) { ["person"]=> &array(1) { [0]=> @@ -157,9 +157,9 @@ string(12) "FooBarBarBaz" ArrayAccessReferenceProxy::__construct(0) ArrayAccessReferenceProxy::offsetUnset(0, name) ArrayAccessReferenceProxy::__construct(0) -object(ArrayAccessReferenceProxy)#1 (3) { +object(ArrayAccessReferenceProxy)#%d (3) { ["object":"ArrayAccessReferenceProxy":private]=> - object(Peoples)#2 (1) { + object(Peoples)#%d (1) { ["person"]=> &array(1) { [0]=> @@ -191,9 +191,9 @@ unicode(6) "FooBar" unicode(9) "FooBarBaz" ===ArrayOverloading=== ArrayAccessReferenceProxy::__construct(0) -object(ArrayAccessReferenceProxy)#1 (3) { +object(ArrayAccessReferenceProxy)#%d (3) { [u"object":u"ArrayAccessReferenceProxy":private]=> - object(Peoples)#2 (1) { + object(Peoples)#%d (1) { [u"person"]=> &array(1) { [0]=> @@ -236,9 +236,9 @@ unicode(12) "FooBarBarBaz" ArrayAccessReferenceProxy::__construct(0) ArrayAccessReferenceProxy::offsetUnset(0, name) ArrayAccessReferenceProxy::__construct(0) -object(ArrayAccessReferenceProxy)#1 (3) { +object(ArrayAccessReferenceProxy)#%d (3) { [u"object":u"ArrayAccessReferenceProxy":private]=> - object(Peoples)#2 (1) { + object(Peoples)#%d (1) { [u"person"]=> &array(1) { [0]=> diff --git a/tests/classes/interface_optional_arg_002.phpt b/tests/classes/interface_optional_arg_002.phpt new file mode 100644 index 0000000000..92980f65b4 --- /dev/null +++ b/tests/classes/interface_optional_arg_002.phpt @@ -0,0 +1,24 @@ +--TEST-- +default argument value in interface implementation +--SKIPIF-- + +--FILE-- +bar(); + +?> +--EXPECT-- +int(2) \ No newline at end of file diff --git a/tests/classes/method_override_optional_arg_001.phpt b/tests/classes/method_override_optional_arg_001.phpt new file mode 100644 index 0000000000..d338fad3d8 --- /dev/null +++ b/tests/classes/method_override_optional_arg_001.phpt @@ -0,0 +1,31 @@ +--TEST-- +Method override allows optional default argument +--SKIPIF-- + +--FILE-- +foo(1); + +?> +--EXPECTF-- +Fatal error: Declaration of C::foo() must be compatible with that of A::foo() in %s on line %d diff --git a/tests/classes/method_override_optional_arg_002.phpt b/tests/classes/method_override_optional_arg_002.phpt new file mode 100644 index 0000000000..3b4fd27201 --- /dev/null +++ b/tests/classes/method_override_optional_arg_002.phpt @@ -0,0 +1,21 @@ +--TEST-- +Omitting optional arg in method inherited from abstract class +--FILE-- +foo(); + +?> +--EXPECTF-- +Fatal error: Declaration of B::foo() must be compatible with that of A::foo() in %s on line %d