cvs: ZendEngine2 /tests call_static_002.phpt call_static_003.phpt call_static_004.phpt call_static_005.phpt call_static_006.phpt call_static_007.phpt
| From: | Felipe Pena | Date: | Tue, 03 Jun 2008 15:36:59 +0000 |
| Subject: | cvs: ZendEngine2 /tests call_static_002.phpt call_static_003.phpt call_static_004.phpt call_static_005.phpt call_static_006.phpt call_static_007.phpt | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-6769@lists.php.net to get a copy of this message | ||
felipe Tue Jun 3 15:36:59 2008 UTC
Modified files:
/ZendEngine2/tests call_static_002.phpt call_static_003.phpt
call_static_004.phpt call_static_005.phpt
call_static_006.phpt call_static_007.phpt
Log:
- New tests
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/call_static_002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/call_static_002.phpt
diff -u /dev/null ZendEngine2/tests/call_static_002.phpt:1.2
--- /dev/null Tue Jun 3 15:36:59 2008
+++ ZendEngine2/tests/call_static_002.phpt Tue Jun 3 15:36:59 2008
@@ -0,0 +1,28 @@
+--TEST--
+Testing __call and __callstatic with callbacks
+--XFAIL--
+http://bugs.php.net/bug.php?id=45089
+--FILE--
+<?php
+
+class Foo {
+ public function __call($a, $b) {
+ print "nonstatic\n";
+ var_dump($a);
+ }
+ static public function __callStatic($a, $b) {
+ print "static\n";
+ var_dump($a);
+ }
+}
+
+$a = new Foo;
+call_user_func(array($a, 'aAa'));
+call_user_func(array('Foo', 'aAa'));
+
+?>
+--EXPECTF--
+nonstatic
+unicode(3) "aAa"
+static
+unicode(3) "aAa"
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/call_static_003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/call_static_003.phpt
diff -u /dev/null ZendEngine2/tests/call_static_003.phpt:1.2
--- /dev/null Tue Jun 3 15:36:59 2008
+++ ZendEngine2/tests/call_static_003.phpt Tue Jun 3 15:36:59 2008
@@ -0,0 +1,40 @@
+--TEST--
+Testing method name case
+--XFAIL--
+http://bugs.php.net/bug.php?id=45089
+--FILE--
+<?php
+
+class Foo {
+ public function __call($a, $b) {
+ print "nonstatic\n";
+ var_dump($a);
+ }
+ static public function __callStatic($a, $b) {
+ print "static\n";
+ var_dump($a);
+ }
+ public function test() {
+ $this->fOoBaR();
+ self::foOBAr();
+ $this::fOOBAr();
+ }
+}
+
+$a = new Foo;
+$a->test();
+$a::bAr();
+foo::BAZ();
+
+?>
+--EXPECT--
+nonstatic
+unicode(6) "fOoBaR"
+nonstatic
+unicode(6) "foOBAr"
+nonstatic
+unicode(6) "fOOBAr"
+static
+unicode(3) "bAr"
+static
+unicode(3) "BAZ"
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/call_static_004.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/call_static_004.phpt
diff -u /dev/null ZendEngine2/tests/call_static_004.phpt:1.2
--- /dev/null Tue Jun 3 15:36:59 2008
+++ ZendEngine2/tests/call_static_004.phpt Tue Jun 3 15:36:59 2008
@@ -0,0 +1,23 @@
+--TEST--
+Invalid method name in dynamic static call
+--XFAIL--
+http://bugs.php.net/bug.php?id=45089
+--FILE--
+<?php
+
+class foo {
+ static function __callstatic($a, $b) {
+ var_dump($a);
+ }
+}
+
+foo::AaA();
+
+$a = 1;
+foo::$a();
+
+?>
+--EXPECTF--
+unicode(3) "AaA"
+
+Fatal error: Function name must be a string in %s on line %d
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/call_static_005.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/call_static_005.phpt
diff -u /dev/null ZendEngine2/tests/call_static_005.phpt:1.2
--- /dev/null Tue Jun 3 15:36:59 2008
+++ ZendEngine2/tests/call_static_005.phpt Tue Jun 3 15:36:59 2008
@@ -0,0 +1,17 @@
+--TEST--
+Invalid method name in dynamic static call
+--FILE--
+<?php
+
+class foo {
+ static function __callstatic($a, $b) {
+ var_dump($a);
+ }
+}
+
+$a = 'foo::';
+$a();
+
+?>
+--EXPECTF--
+Fatal error: Call to undefined function foo::() in %s on line %d
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/call_static_006.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/call_static_006.phpt
diff -u /dev/null ZendEngine2/tests/call_static_006.phpt:1.2
--- /dev/null Tue Jun 3 15:36:59 2008
+++ ZendEngine2/tests/call_static_006.phpt Tue Jun 3 15:36:59 2008
@@ -0,0 +1,32 @@
+--TEST--
+Testing __callStatic
+--XFAIL--
+http://bugs.php.net/bug.php?id=45089
+--FILE--
+<?php
+
+class foo {
+ public function aa() {
+ print "ok\n";
+ }
+ static function __callstatic($a, $b) {
+ var_dump($a);
+ }
+}
+
+foo::aa();
+
+$b = 'AA';
+foo::$b();
+
+foo::__construct();
+
+?>
+--EXPECTF--
+Strict Standards: Non-static method foo::aa() should not be called statically in %s on line %d
+ok
+
+Strict Standards: Non-static method foo::aa() should not be called statically in %s on line %d
+ok
+
+Fatal error: Can not call constructor in %s on line %d
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/call_static_007.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/call_static_007.phpt
diff -u /dev/null ZendEngine2/tests/call_static_007.phpt:1.2
--- /dev/null Tue Jun 3 15:36:59 2008
+++ ZendEngine2/tests/call_static_007.phpt Tue Jun 3 15:36:59 2008
@@ -0,0 +1,36 @@
+--TEST--
+Testing __call and __callstatic
+--XFAIL--
+http://bugs.php.net/bug.php?id=45089
+--FILE--
+<?php
+
+class a {
+ public function __call($a, $b) {
+ print "__call: ". $a ."\n";
+ }
+ static public function __callStatic($a, $b) {
+ print "__callstatic: ". $a ."\n";
+ }
+ public function baz() {
+ self::Bar();
+ }
+}
+
+
+$a = new a;
+
+$b = 'Test';
+$a::$b();
+$a->$b();
+
+$a->baz();
+
+a::Foo();
+
+?>
+--EXPECT--
+__callstatic: Test
+__call: Test
+__call: Bar
+__callstatic: Foo