From: Felipe Pena Date: Wed, 12 Mar 2008 12:58:12 +0000 (+0000) Subject: New tests X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~607 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5fa8f63a01fd6cc72c90dd50b7660505fbcce327;p=php New tests --- diff --git a/Zend/tests/access_modifiers_010.phpt b/Zend/tests/access_modifiers_010.phpt new file mode 100644 index 0000000000..637ea36ce9 --- /dev/null +++ b/Zend/tests/access_modifiers_010.phpt @@ -0,0 +1,31 @@ +--TEST-- +Testing visibility of methods +--FILE-- +test2(); + } +} + +abstract class b extends a { +} + +class c extends b { + public function __construct() { + $this->test(); + } +} + +new c; + +?> +--EXPECTF-- +Fatal error: Call to private method d::test2() from context 'a' in %s on line %d diff --git a/Zend/tests/errmsg_044.phpt b/Zend/tests/errmsg_044.phpt new file mode 100644 index 0000000000..78a85f8b60 --- /dev/null +++ b/Zend/tests/errmsg_044.phpt @@ -0,0 +1,11 @@ +--TEST-- +Trying use object of type stdClass as array +--FILE-- + +--EXPECT-- +Fatal error: Cannot use object of type stdClass as array in %s on line %d diff --git a/Zend/tests/foreach_002.phpt b/Zend/tests/foreach_002.phpt new file mode 100644 index 0000000000..643e653927 --- /dev/null +++ b/Zend/tests/foreach_002.phpt @@ -0,0 +1,23 @@ +--TEST-- +Creating recursive array on foreach using same variable +--FILE-- + array('a' => &$a))) as $a) { + var_dump($a); +} + +?> +--EXPECT-- +array(1) { + ["a"]=> + &array(1) { + ["a"]=> + &array(1) { + ["a"]=> + *RECURSION* + } + } +} diff --git a/Zend/tests/inter_03.phpt b/Zend/tests/inter_03.phpt new file mode 100644 index 0000000000..c91f4aa142 --- /dev/null +++ b/Zend/tests/inter_03.phpt @@ -0,0 +1,19 @@ +--TEST-- +Testing interface constants with inheritance +--FILE-- + +--EXPECT-- +int(2) +int(2) diff --git a/Zend/tests/list_001.phpt b/Zend/tests/list_001.phpt new file mode 100644 index 0000000000..a9fff55004 --- /dev/null +++ b/Zend/tests/list_001.phpt @@ -0,0 +1,14 @@ +--TEST-- +"Nested" list() +--FILE-- + +--EXPECT-- +object(stdClass)#1 (0) { +} +object(stdClass)#2 (0) { +} diff --git a/Zend/tests/list_002.phpt b/Zend/tests/list_002.phpt new file mode 100644 index 0000000000..ac0d8974be --- /dev/null +++ b/Zend/tests/list_002.phpt @@ -0,0 +1,20 @@ +--TEST-- +Testing full-reference on list() +--FILE-- + +--EXPECT-- +object(stdClass)#1 (0) { +} +object(stdClass)#1 (0) { +} +bool(true) diff --git a/Zend/tests/objects_019.phpt b/Zend/tests/objects_019.phpt new file mode 100644 index 0000000000..53889edfab --- /dev/null +++ b/Zend/tests/objects_019.phpt @@ -0,0 +1,32 @@ +--TEST-- +Testing references of dynamic properties +--FILE-- +a = &$foo[0]->a; +$foo[0]->a = 2; + +$x = $foo[1]->a; +$x = 'foo'; + +var_dump($foo, $x); + +?> +--EXPECT-- +array(2) { + [0]=> + object(stdClass)#1 (1) { + ["a"]=> + &int(2) + } + [1]=> + object(stdClass)#2 (1) { + ["a"]=> + &int(2) + } +} +string(3) "foo"