diff options
Diffstat (limited to 'tests/classes')
-rw-r--r-- | tests/classes/abstract.phpt | 30 | ||||
-rw-r--r-- | tests/classes/abstract_class.phpt | 29 | ||||
-rw-r--r-- | tests/classes/abstract_redeclare.phpt | 22 | ||||
-rw-r--r-- | tests/classes/bug20120.phpt | 26 | ||||
-rw-r--r-- | tests/classes/class_example.phpt | 87 | ||||
-rw-r--r-- | tests/classes/inheritance.phpt | 58 | ||||
-rw-r--r-- | tests/classes/static_mix_1.phpt | 26 | ||||
-rw-r--r-- | tests/classes/static_mix_2.phpt | 27 |
8 files changed, 0 insertions, 305 deletions
diff --git a/tests/classes/abstract.phpt b/tests/classes/abstract.phpt deleted file mode 100644 index 4a2cfbaad2..0000000000 --- a/tests/classes/abstract.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -An abstract method may not be called ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> ---FILE-- -<?php - -class fail { - abstract function show(); -} - -class pass extends fail { - function show() { - echo "Call to function show()\n"; - } - function error() { - parent::show(); - } -} - -$t = new pass(); -$t->show(); -$t->error(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call to function show() - -Fatal error: Cannot call abstract method fail::show() in %s on line %d diff --git a/tests/classes/abstract_class.phpt b/tests/classes/abstract_class.phpt deleted file mode 100644 index df123e038b..0000000000 --- a/tests/classes/abstract_class.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -An abstract class cannot be instanciated ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> ---FILE-- -<?php - -class fail { - abstract function show(); -} - -class pass extends fail { - function show() { - echo "Call to function show()\n"; - } -} - -$t2 = new pass(); -$t2->show(); - -$t = new fail(); -$t->show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Call to function show() - -Fatal error: Cannot instantiate abstract class fail in %s on line %d diff --git a/tests/classes/abstract_redeclare.phpt b/tests/classes/abstract_redeclare.phpt deleted file mode 100644 index 132ab94711..0000000000 --- a/tests/classes/abstract_redeclare.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -A method cannot be redeclared abstrcat ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> ---FILE-- -<?php - -class pass { - function show() { - echo "Call to function show()\n"; - } -} - -class fail extends pass { - abstract function show(); -} - -echo "Done\n"; // Shouldn't be displayed -?> ---EXPECTF-- - -Fatal error: Cannot make non abstract method pass::show() abstract in class fail in %s on line %d diff --git a/tests/classes/bug20120.phpt b/tests/classes/bug20120.phpt deleted file mode 100644 index 8cc326eb09..0000000000 --- a/tests/classes/bug20120.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Methods via variable name, bug #20120 ---SKIP-- ---FILE-- -<?php -class bugtest { - function bug() { - echo "test\n"; - } - function refbug() { - echo "test2\n"; - } -} -$method='bug'; -bugtest::$method(); -$foo=&$method; -$method='refbug'; -bugtest::$foo(); - -$t = new bugtest; -$t->$method(); -?> ---EXPECT-- -test -test2 -test2 diff --git a/tests/classes/class_example.phpt b/tests/classes/class_example.phpt deleted file mode 100644 index 8f07c278fc..0000000000 --- a/tests/classes/class_example.phpt +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -Classes general test ---POST-- ---GET-- ---FILE-- - -<?php - -/* pretty nifty object oriented code! */ - -class user { - var $first_name,$family_name,$address,$phone_num; - function display() - { - echo "User information\n"; - echo "----------------\n\n"; - echo "First name:\t ".$this->first_name."\n"; - echo "Family name:\t ".$this->family_name."\n"; - echo "Address:\t ".$this->address."\n"; - echo "Phone:\t\t ".$this->phone_num."\n"; - echo "\n\n"; - } - function initialize($first_name,$family_name,$address,$phone_num) - { - $this->first_name = $first_name; - $this->family_name = $family_name; - $this->address = $address; - $this->phone_num = $phone_num; - } -}; - - -function test($u) -{ /* one can pass classes as arguments */ - $u->display(); - $t = $u; - $t->address = "New address..."; - return $t; /* and also return them as return values */ -} - -$user1 = new user; -$user2 = new user; - -$user1->initialize("Zeev","Suraski","Ben Gourion 3, Kiryat Bialik, Israel","+972-4-8713139"); -$user2->initialize("Andi","Gutmans","Haifa, Israel","+972-4-8231621"); -$user1->display(); -$user2->display(); - -$tmp = test($user2); -$tmp->display(); - -?> ---EXPECT-- -User information ----------------- - -First name: Zeev -Family name: Suraski -Address: Ben Gourion 3, Kiryat Bialik, Israel -Phone: +972-4-8713139 - - -User information ----------------- - -First name: Andi -Family name: Gutmans -Address: Haifa, Israel -Phone: +972-4-8231621 - - -User information ----------------- - -First name: Andi -Family name: Gutmans -Address: Haifa, Israel -Phone: +972-4-8231621 - - -User information ----------------- - -First name: Andi -Family name: Gutmans -Address: New address... -Phone: +972-4-8231621 diff --git a/tests/classes/inheritance.phpt b/tests/classes/inheritance.phpt deleted file mode 100644 index 2a2f0f755b..0000000000 --- a/tests/classes/inheritance.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -Classes inheritance test ---POST-- ---GET-- ---FILE-- -<?php - -/* Inheritance test. Pretty nifty if I do say so myself! */ - -class foo { - var $a; - var $b; - function display() { - echo "This is class foo\n"; - echo "a = ".$this->a."\n"; - echo "b = ".$this->b."\n"; - } - function mul() { - return $this->a*$this->b; - } -}; - -class bar extends foo { - var $c; - function display() { /* alternative display function for class bar */ - echo "This is class bar\n"; - echo "a = ".$this->a."\n"; - echo "b = ".$this->b."\n"; - echo "c = ".$this->c."\n"; - } -}; - - -$foo1 = new foo; -$foo1->a = 2; -$foo1->b = 5; -$foo1->display(); -echo $foo1->mul()."\n"; - -echo "-----\n"; - -$bar1 = new bar; -$bar1->a = 4; -$bar1->b = 3; -$bar1->c = 12; -$bar1->display(); -echo $bar1->mul()."\n"; ---EXPECT-- -This is class foo -a = 2 -b = 5 -10 ------ -This is class bar -a = 4 -b = 3 -c = 12 -12 diff --git a/tests/classes/static_mix_1.phpt b/tests/classes/static_mix_1.phpt deleted file mode 100644 index 06e7882694..0000000000 --- a/tests/classes/static_mix_1.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -You cannot overload a static method with a non static method ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> ---FILE-- -<?php - -class pass { - static function show() { - echo "Call to function pass::show()\n"; - } -} - -class fail extends pass { - function show() { - echo "Call to function fail::show()\n"; - } -} - -pass::show(); -fail::show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Fatal error: Cannot make static method pass::show() non static in class fail in %s on line %d
\ No newline at end of file diff --git a/tests/classes/static_mix_2.phpt b/tests/classes/static_mix_2.phpt deleted file mode 100644 index 3052271307..0000000000 --- a/tests/classes/static_mix_2.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -You cannot overload a non static method with a static method ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> ---FILE-- -<?php - -class pass { - function show() { - echo "Call to function pass::show()\n"; - } -} - -class fail extends pass { - static function show() { - echo "Call to function fail::show()\n"; - } -} - -$t = new pass(); -$t->show(); -fail::show(); - -echo "Done\n"; // shouldn't be displayed -?> ---EXPECTF-- -Fatal error: Cannot make non static method pass::show() static in class fail in %s on line %d
\ No newline at end of file |