summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2002-12-07 14:27:29 +0000
committerMarcus Boerger <helly@php.net>2002-12-07 14:27:29 +0000
commit8e268d281640f1da50b970f6da2408d323544fd1 (patch)
tree3665167609af65af19dd27cc5981d82fd3bff2da
parent495f544d4bea4a55054b7e8220487b93d5a930ab (diff)
downloadphp-git-8e268d281640f1da50b970f6da2408d323544fd1.tar.gz
Adding a test for abstract class instanciation
-rw-r--r--tests/classes/abstract_class.phpt29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/classes/abstract_class.phpt b/tests/classes/abstract_class.phpt
new file mode 100644
index 0000000000..aa0a90dc88
--- /dev/null
+++ b/tests/classes/abstract_class.phpt
@@ -0,0 +1,29 @@
+--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 of cause
+?>
+--EXPECTF--
+Call to function show()
+
+Fatal error: Cannot instanciate abstract class fail in %s on line %d