summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-12-13 13:51:15 +0000
committerAntony Dovgal <tony2001@php.net>2007-12-13 13:51:15 +0000
commit2569b593f14ee4a95ea2b88c6ba09ecea67472a3 (patch)
tree7199f73e42e5d43ea8355643264c193df0a9890b /Zend
parent64e8f223556d905ff23df31ec40335528113e40c (diff)
downloadphp-git-2569b593f14ee4a95ea2b88c6ba09ecea67472a3.tar.gz
MFH: add new tests written by Felipe Pena
Diffstat (limited to 'Zend')
-rw-r--r--Zend/tests/constructor_args.phpt20
-rw-r--r--Zend/tests/inter_01.phpt18
-rw-r--r--Zend/tests/inter_02.phpt21
3 files changed, 59 insertions, 0 deletions
diff --git a/Zend/tests/constructor_args.phpt b/Zend/tests/constructor_args.phpt
new file mode 100644
index 0000000000..8056874286
--- /dev/null
+++ b/Zend/tests/constructor_args.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Different numbers of arguments in __construct()
+--FILE--
+<?php
+interface foobar {
+ function __construct();
+}
+abstract class bar implements foobar {
+ public function __construct($x = 1) {
+ }
+}
+final class foo extends bar implements foobar {
+ public function __construct($x = 1, $y = 2) {
+ }
+}
+new foo;
+print "ok!";
+?>
+--EXPECT--
+ok!
diff --git a/Zend/tests/inter_01.phpt b/Zend/tests/inter_01.phpt
new file mode 100644
index 0000000000..db2e86d206
--- /dev/null
+++ b/Zend/tests/inter_01.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Inherited constant from interface
+--FILE--
+<?php
+interface foo {
+ const foo = 'foobar';
+ public function bar($x = foo);
+}
+
+class foobar implements foo {
+ const foo = 'bar';
+ public function bar($x = foo::foo) {
+ var_dump($x);
+ }
+}
+?>
+--EXPECTF--
+Fatal error: Cannot inherit previously-inherited constant foo from interface foo in %s on line %d
diff --git a/Zend/tests/inter_02.phpt b/Zend/tests/inter_02.phpt
new file mode 100644
index 0000000000..18db230b21
--- /dev/null
+++ b/Zend/tests/inter_02.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Namespace constant as value default
+--FILE--
+<?php
+
+namespace foo;
+
+error_reporting(E_ALL);
+
+interface foo {
+ const foo = 2;
+}
+
+function foo($x = foo::foo::foo) {
+ var_dump($x);
+}
+
+foo();
+?>
+--EXPECT--
+int(2)