From: Antony Dovgal Date: Fri, 2 Feb 2007 12:53:54 +0000 (+0000) Subject: add new tests X-Git-Tag: RELEASE_1_0_0RC1~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=535e38a47361813d1ebb611dc498663d68802f94;p=php add new tests --- diff --git a/Zend/tests/errmsg_001.phpt b/Zend/tests/errmsg_001.phpt new file mode 100644 index 0000000000..b85e032b90 --- /dev/null +++ b/Zend/tests/errmsg_001.phpt @@ -0,0 +1,16 @@ +--TEST-- +errmsg: Non-abstract method must contain body +--FILE-- + +--EXPECTF-- +Fatal error: Non-abstract method Impl::Foo() must contain body in %s on line %d diff --git a/Zend/tests/errmsg_002.phpt b/Zend/tests/errmsg_002.phpt new file mode 100644 index 0000000000..b7330c9f1f --- /dev/null +++ b/Zend/tests/errmsg_002.phpt @@ -0,0 +1,14 @@ +--TEST-- +errmsg: function cannot be declared private +--FILE-- + +--EXPECTF-- +Fatal error: Abstract function test::foo() cannot be declared private in %s on line %d diff --git a/Zend/tests/errmsg_003.phpt b/Zend/tests/errmsg_003.phpt new file mode 100644 index 0000000000..64e458781d --- /dev/null +++ b/Zend/tests/errmsg_003.phpt @@ -0,0 +1,19 @@ +--TEST-- +errmsg: cannot reassign $this (by ref) +--FILE-- +foo(); + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Cannot re-assign $this in %s on line %d diff --git a/Zend/tests/errmsg_004.phpt b/Zend/tests/errmsg_004.phpt new file mode 100644 index 0000000000..e6d22d6aba --- /dev/null +++ b/Zend/tests/errmsg_004.phpt @@ -0,0 +1,15 @@ +--TEST-- +errmsg: can't use function return value in write context +--FILE-- + +--EXPECTF-- +Fatal error: Can't use function return value in write context in %s on line %d diff --git a/Zend/tests/errmsg_005.phpt b/Zend/tests/errmsg_005.phpt new file mode 100644 index 0000000000..31c924cbb3 --- /dev/null +++ b/Zend/tests/errmsg_005.phpt @@ -0,0 +1,18 @@ +--TEST-- +errmsg: can't use method return value in write context +--FILE-- +foo() = 1; + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Can't use method return value in write context in %s on line %d diff --git a/Zend/tests/errmsg_006.phpt b/Zend/tests/errmsg_006.phpt new file mode 100644 index 0000000000..976093d854 --- /dev/null +++ b/Zend/tests/errmsg_006.phpt @@ -0,0 +1,12 @@ +--TEST-- +errmsg: can't use [] for reading +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use [] for reading in %s on line %d diff --git a/Zend/tests/errmsg_007.phpt b/Zend/tests/errmsg_007.phpt new file mode 100644 index 0000000000..1ac296695d --- /dev/null +++ b/Zend/tests/errmsg_007.phpt @@ -0,0 +1,12 @@ +--TEST-- +errmsg: can't use [] for reading - 2 +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use [] for reading in %s on line %d diff --git a/Zend/tests/errmsg_008.phpt b/Zend/tests/errmsg_008.phpt new file mode 100644 index 0000000000..e900603a89 --- /dev/null +++ b/Zend/tests/errmsg_008.phpt @@ -0,0 +1,12 @@ +--TEST-- +errmsg: can't use [] for unsetting +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use [] for unsetting in %s on line %d diff --git a/Zend/tests/errmsg_009.phpt b/Zend/tests/errmsg_009.phpt new file mode 100644 index 0000000000..4834fa3e7a --- /dev/null +++ b/Zend/tests/errmsg_009.phpt @@ -0,0 +1,13 @@ +--TEST-- +errmsg: multiple access type modifiers are not allowed (properties) +--FILE-- + +--EXPECTF-- +Fatal error: Multiple access type modifiers are not allowed in %s on line %d diff --git a/Zend/tests/errmsg_010.phpt b/Zend/tests/errmsg_010.phpt new file mode 100644 index 0000000000..ae2572f7bc --- /dev/null +++ b/Zend/tests/errmsg_010.phpt @@ -0,0 +1,13 @@ +--TEST-- +errmsg: multiple access type modifiers are not allowed (methods) +--FILE-- + +--EXPECTF-- +Fatal error: Multiple access type modifiers are not allowed in %s on line %d diff --git a/Zend/tests/errmsg_011.phpt b/Zend/tests/errmsg_011.phpt new file mode 100644 index 0000000000..9cfde0f8bb --- /dev/null +++ b/Zend/tests/errmsg_011.phpt @@ -0,0 +1,16 @@ +--TEST-- +errmsg: cannot redeclare (method) +--FILE-- + +--EXPECTF-- +Fatal error: Cannot redeclare test::foo() in %s on line %d diff --git a/Zend/tests/errmsg_012.phpt b/Zend/tests/errmsg_012.phpt new file mode 100644 index 0000000000..183785be04 --- /dev/null +++ b/Zend/tests/errmsg_012.phpt @@ -0,0 +1,11 @@ +--TEST-- +errmsg: __autoload() must take exactly 1 argument +--FILE-- + +--EXPECTF-- +Fatal error: __autoload() must take exactly 1 argument in %s on line %d diff --git a/Zend/tests/errmsg_013.phpt b/Zend/tests/errmsg_013.phpt new file mode 100644 index 0000000000..d1f248ec28 --- /dev/null +++ b/Zend/tests/errmsg_013.phpt @@ -0,0 +1,14 @@ +--TEST-- +errmsg: default value for parameters with array type hint can only be an array or NULL +--FILE-- + +--EXPECTF-- +Fatal error: Default value for parameters with array type hint can only be an array or NULL in %s on line %d diff --git a/Zend/tests/errmsg_014.phpt b/Zend/tests/errmsg_014.phpt new file mode 100644 index 0000000000..77e12b05e9 --- /dev/null +++ b/Zend/tests/errmsg_014.phpt @@ -0,0 +1,17 @@ +--TEST-- +errmsg: cannot call __clone() method on objects +--FILE-- +__clone(); + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Cannot call __clone() method on objects - use 'clone $obj' instead in %s on line %d diff --git a/Zend/tests/errmsg_015.phpt b/Zend/tests/errmsg_015.phpt new file mode 100644 index 0000000000..8e626e5092 --- /dev/null +++ b/Zend/tests/errmsg_015.phpt @@ -0,0 +1,14 @@ +--TEST-- +errmsg: __clone() cannot accept any arguments +--FILE-- + +--EXPECTF-- +Fatal error: Method test::__clone() cannot accept any arguments in %s on line %d diff --git a/Zend/tests/errmsg_016.phpt b/Zend/tests/errmsg_016.phpt new file mode 100644 index 0000000000..ccda07b9a3 --- /dev/null +++ b/Zend/tests/errmsg_016.phpt @@ -0,0 +1,14 @@ +--TEST-- +errmsg: __isset() must take exactly 1 argument +--FILE-- + +--EXPECTF-- +Fatal error: Method test::__isset() must take exactly 1 argument in %s on line %d diff --git a/Zend/tests/errmsg_017.phpt b/Zend/tests/errmsg_017.phpt new file mode 100644 index 0000000000..df2b665687 --- /dev/null +++ b/Zend/tests/errmsg_017.phpt @@ -0,0 +1,14 @@ +--TEST-- +errmsg: __unset() must take exactly 1 argument +--FILE-- + +--EXPECTF-- +Fatal error: Method test::__unset() must take exactly 1 argument in %s on line %d diff --git a/Zend/tests/errmsg_018.phpt b/Zend/tests/errmsg_018.phpt new file mode 100644 index 0000000000..9776753c60 --- /dev/null +++ b/Zend/tests/errmsg_018.phpt @@ -0,0 +1,13 @@ +--TEST-- +errmsg: static abstract function +--FILE-- + +--EXPECTF-- +Fatal error: Static function test::foo() cannot be abstract in %s on line %d diff --git a/Zend/tests/errmsg_019.phpt b/Zend/tests/errmsg_019.phpt new file mode 100644 index 0000000000..2b45650cf2 --- /dev/null +++ b/Zend/tests/errmsg_019.phpt @@ -0,0 +1,14 @@ +--TEST-- +errmsg: __destruct() cannot take arguments +--FILE-- + +--EXPECTF-- +Fatal error: Destructor test::__destruct() cannot take arguments in %s on line %d diff --git a/Zend/tests/errmsg_020.phpt b/Zend/tests/errmsg_020.phpt new file mode 100644 index 0000000000..8199d5d06e --- /dev/null +++ b/Zend/tests/errmsg_020.phpt @@ -0,0 +1,14 @@ +--TEST-- +errmsg: disabled function +--INI-- +disable_functions=phpinfo +--FILE-- + +--EXPECTF-- +Warning: phpinfo() has been disabled for security reasons in %s on line %d +Done diff --git a/Zend/tests/errmsg_021.phpt b/Zend/tests/errmsg_021.phpt new file mode 100644 index 0000000000..99485ef26e --- /dev/null +++ b/Zend/tests/errmsg_021.phpt @@ -0,0 +1,16 @@ +--TEST-- +errmsg: disabled class +--INI-- +disable_classes=stdclass +--FILE-- + +--EXPECTF-- +Fatal error: Class 'stdclass' not found in %s on line %d diff --git a/Zend/tests/errmsg_022.phpt b/Zend/tests/errmsg_022.phpt new file mode 100644 index 0000000000..ea7b082f9e --- /dev/null +++ b/Zend/tests/errmsg_022.phpt @@ -0,0 +1,14 @@ +--TEST-- +errmsg: only variables can be passed by reference +--FILE-- + +--EXPECTF-- +Fatal error: Only variables can be passed by reference in %s on line %d diff --git a/Zend/tests/errmsg_023.phpt b/Zend/tests/errmsg_023.phpt new file mode 100644 index 0000000000..9fd7804ea4 --- /dev/null +++ b/Zend/tests/errmsg_023.phpt @@ -0,0 +1,17 @@ +--TEST-- +errmsg: access level must be the same or weaker +--FILE-- + +--EXPECTF-- +Fatal error: Access level to test::$var must be protected (as in class test1) or weaker in %s on line %d diff --git a/Zend/tests/errmsg_024.phpt b/Zend/tests/errmsg_024.phpt new file mode 100644 index 0000000000..d8d06cbce1 --- /dev/null +++ b/Zend/tests/errmsg_024.phpt @@ -0,0 +1,17 @@ +--TEST-- +errmsg: cannot change initial value of property +--FILE-- + +--EXPECTF-- +Fatal error: Cannot change initial value of property static protected test1::$var in class test in %s on line %d diff --git a/Zend/tests/errmsg_025.phpt b/Zend/tests/errmsg_025.phpt new file mode 100644 index 0000000000..d853f73428 --- /dev/null +++ b/Zend/tests/errmsg_025.phpt @@ -0,0 +1,20 @@ +--TEST-- +errmsg: cannot inherit previously inherited constant +--FILE-- + +--EXPECTF-- +Fatal error: Cannot inherit previously-inherited constant FOO from interface test2 in %s on line %d diff --git a/Zend/tests/errmsg_026.phpt b/Zend/tests/errmsg_026.phpt new file mode 100644 index 0000000000..1954122900 --- /dev/null +++ b/Zend/tests/errmsg_026.phpt @@ -0,0 +1,12 @@ +--TEST-- +errmsg: cannot redeclare class +--FILE-- + +--EXPECTF-- +Fatal error: Cannot redeclare class stdclass in %s on line %d diff --git a/Zend/tests/errmsg_027.phpt b/Zend/tests/errmsg_027.phpt new file mode 100644 index 0000000000..f4fec6155c --- /dev/null +++ b/Zend/tests/errmsg_027.phpt @@ -0,0 +1,16 @@ +--TEST-- +errmsg: class declarations may not be nested +--FILE-- + +--EXPECTF-- +Fatal error: Class declarations may not be nested in %s on line %d diff --git a/Zend/tests/errmsg_028.phpt b/Zend/tests/errmsg_028.phpt new file mode 100644 index 0000000000..3331cb35bf --- /dev/null +++ b/Zend/tests/errmsg_028.phpt @@ -0,0 +1,12 @@ +--TEST-- +errmsg: cannot use 'self' as class name +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use 'self' as class name as it is reserved in %s on line %d diff --git a/Zend/tests/errmsg_029.phpt b/Zend/tests/errmsg_029.phpt new file mode 100644 index 0000000000..73b85ce6a5 --- /dev/null +++ b/Zend/tests/errmsg_029.phpt @@ -0,0 +1,12 @@ +--TEST-- +errmsg: cannot use 'parent' as class name +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use 'parent' as class name as it is reserved in %s on line %d diff --git a/Zend/tests/errmsg_030.phpt b/Zend/tests/errmsg_030.phpt new file mode 100644 index 0000000000..ab6ccbd41e --- /dev/null +++ b/Zend/tests/errmsg_030.phpt @@ -0,0 +1,12 @@ +--TEST-- +errmsg: cannot use 'self' as parent class name +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use 'self' as class name as it is reserved in %s on line %d diff --git a/Zend/tests/errmsg_031.phpt b/Zend/tests/errmsg_031.phpt new file mode 100644 index 0000000000..6e35648549 --- /dev/null +++ b/Zend/tests/errmsg_031.phpt @@ -0,0 +1,12 @@ +--TEST-- +errmsg: cannot use 'parent' as parent class name +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use 'parent' as class name as it is reserved in %s on line %d diff --git a/Zend/tests/errmsg_032.phpt b/Zend/tests/errmsg_032.phpt new file mode 100644 index 0000000000..6e34604cd8 --- /dev/null +++ b/Zend/tests/errmsg_032.phpt @@ -0,0 +1,15 @@ +--TEST-- +errmsg: __construct() cannot be static +--FILE-- + +--EXPECTF-- +Fatal error: Constructor test::__construct() cannot be static in %s on line %d diff --git a/Zend/tests/errmsg_033.phpt b/Zend/tests/errmsg_033.phpt new file mode 100644 index 0000000000..96938900ec --- /dev/null +++ b/Zend/tests/errmsg_033.phpt @@ -0,0 +1,15 @@ +--TEST-- +errmsg: __destruct() cannot be static +--FILE-- + +--EXPECTF-- +Fatal error: Destructor test::__destruct() cannot be static in %s on line %d diff --git a/Zend/tests/errmsg_034.phpt b/Zend/tests/errmsg_034.phpt new file mode 100644 index 0000000000..1494fe5321 --- /dev/null +++ b/Zend/tests/errmsg_034.phpt @@ -0,0 +1,15 @@ +--TEST-- +errmsg: __clone() cannot be static +--FILE-- + +--EXPECTF-- +Fatal error: Clone method test::__clone() cannot be static in %s on line %d diff --git a/Zend/tests/errmsg_035.phpt b/Zend/tests/errmsg_035.phpt new file mode 100644 index 0000000000..76cbe3d48b --- /dev/null +++ b/Zend/tests/errmsg_035.phpt @@ -0,0 +1,12 @@ +--TEST-- +errmsg: cannot use 'self' as interface name +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use 'self' as interface name as it is reserved in %s on line %d diff --git a/Zend/tests/errmsg_036.phpt b/Zend/tests/errmsg_036.phpt new file mode 100644 index 0000000000..d1f4274bd1 --- /dev/null +++ b/Zend/tests/errmsg_036.phpt @@ -0,0 +1,12 @@ +--TEST-- +errmsg: cannot use 'parent' as interface name +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use 'parent' as interface name as it is reserved in %s on line %d diff --git a/Zend/tests/errmsg_037.phpt b/Zend/tests/errmsg_037.phpt new file mode 100644 index 0000000000..6b98bb3339 --- /dev/null +++ b/Zend/tests/errmsg_037.phpt @@ -0,0 +1,13 @@ +--TEST-- +errmsg: properties cannot be abstract +--FILE-- + +--EXPECTF-- +Fatal error: Properties cannot be declared abstract in %s on line %d diff --git a/Zend/tests/errmsg_038.phpt b/Zend/tests/errmsg_038.phpt new file mode 100644 index 0000000000..fdab803ba8 --- /dev/null +++ b/Zend/tests/errmsg_038.phpt @@ -0,0 +1,13 @@ +--TEST-- +errmsg: properties cannot be final +--FILE-- + +--EXPECTF-- +Fatal error: Cannot declare property test::$var final, the final modifier is allowed only for methods in %s on line %d diff --git a/Zend/tests/errmsg_039.phpt b/Zend/tests/errmsg_039.phpt new file mode 100644 index 0000000000..0000811879 --- /dev/null +++ b/Zend/tests/errmsg_039.phpt @@ -0,0 +1,14 @@ +--TEST-- +errmsg: cannot redeclare property +--FILE-- + +--EXPECTF-- +Fatal error: Cannot redeclare test::$var in %s on line %d diff --git a/Zend/tests/errmsg_040.phpt b/Zend/tests/errmsg_040.phpt new file mode 100644 index 0000000000..f3d0afcf0a --- /dev/null +++ b/Zend/tests/errmsg_040.phpt @@ -0,0 +1,13 @@ +--TEST-- +errmsg: arrays are not allowed in class constants +--FILE-- + +--EXPECTF-- +Fatal error: Arrays are not allowed in class constants in %s on line %d diff --git a/Zend/tests/errmsg_041.phpt b/Zend/tests/errmsg_041.phpt new file mode 100644 index 0000000000..bfcafd261d --- /dev/null +++ b/Zend/tests/errmsg_041.phpt @@ -0,0 +1,11 @@ +--TEST-- +errmsg: instanceof expects an object instance, constant given +--FILE-- + +--EXPECTF-- +Fatal error: instanceof expects an object instance, constant given in %s on line %d diff --git a/Zend/tests/errmsg_042.phpt b/Zend/tests/errmsg_042.phpt new file mode 100644 index 0000000000..3b4ea7c267 --- /dev/null +++ b/Zend/tests/errmsg_042.phpt @@ -0,0 +1,13 @@ +--TEST-- +errmsg: key element cannot be a reference +--FILE-- +$v) { +} + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Key element cannot be a reference in %s on line %d diff --git a/Zend/tests/errmsg_043.phpt b/Zend/tests/errmsg_043.phpt new file mode 100644 index 0000000000..3de8bc2062 --- /dev/null +++ b/Zend/tests/errmsg_043.phpt @@ -0,0 +1,12 @@ +--TEST-- +errmsg: cannot create references to temp array +--FILE-- +&$v) { +} + +echo "Done\n"; +?> +--EXPECTF-- +Fatal error: Cannot create references to elements of a temporary array expression in %s on line %d