helly           Fri Dec 16 22:19:02 2005 EDT

  Added files:                 (Branch: PHP_5_1)
    /php-src/ext/spl/tests      spl_autoload_007.phpt 

  Modified files:              
    /ZendEngine2/tests  bug29210.phpt bug32290.phpt 
    /php-src/ext/standard/tests/general_functions       bug32647.phpt 
    /php-src/tests/classes      bug27504.phpt 
  Log:
  - Add/fix tests
  
  
http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/bug29210.phpt?r1=1.2&r2=1.2.2.1&diff_format=u
Index: ZendEngine2/tests/bug29210.phpt
diff -u ZendEngine2/tests/bug29210.phpt:1.2 
ZendEngine2/tests/bug29210.phpt:1.2.2.1
--- ZendEngine2/tests/bug29210.phpt:1.2 Wed Apr 27 15:45:36 2005
+++ ZendEngine2/tests/bug29210.phpt     Fri Dec 16 22:19:01 2005
@@ -89,10 +89,14 @@
 $object = new foo();
 $object->test();
 ?>
---EXPECT--
+--EXPECTF--
 test_func1
 test_func2
+
+Strict Standards: Non-static method test_class::test_func3() canot be called 
statically, assuming $this from compatible context test_class in %sbug29210.php 
on line %d
 test_func3
+
+Strict Standards: Non-static method test_class::test_func4() canot be called 
statically, assuming $this from compatible context test_class in %sbug29210.php 
on line %d
 test_func4
 test_func1 isn't callable from outside
 test_func2 isn't callable from outside
@@ -100,5 +104,9 @@
 test_func4 isn't callable from outside
 test_func1 isn't callable from child
 test_func2
+
+Strict Standards: Non-static method test_class::test_func3() canot be called 
statically, assuming $this from compatible context foo in %sbug29210.php on 
line %d
 test_func3 isn't callable from child
+
+Strict Standards: Non-static method test_class::test_func4() canot be called 
statically, assuming $this from compatible context foo in %sbug29210.php on 
line %d
 test_func4
http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/bug32290.phpt?r1=1.1&r2=1.1.4.1&diff_format=u
Index: ZendEngine2/tests/bug32290.phpt
diff -u ZendEngine2/tests/bug32290.phpt:1.1 
ZendEngine2/tests/bug32290.phpt:1.1.4.1
--- ZendEngine2/tests/bug32290.phpt:1.1 Sun Mar 13 13:15:08 2005
+++ ZendEngine2/tests/bug32290.phpt     Fri Dec 16 22:19:01 2005
@@ -7,7 +7,31 @@
 {
        public function doSomething($i)
        {
-               echo __METHOD__ . "($this)\n";
+               echo __METHOD__ . "($i)\n";
+               return --$i;
+       }
+
+       public function doSomethingThis($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               return --$i;
+       }
+
+       public function doSomethingParent($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               return --$i;
+       }
+
+       public function doSomethingParentThis($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               return --$i;
+       }
+
+       public static function doSomethingStatic($i)
+       {
+               echo __METHOD__ . "($i)\n";
                return --$i;
        }
 }
@@ -16,20 +40,87 @@
 {
        public function doSomething($i)
        {
-               echo __METHOD__ . "($this)\n";
+               echo __METHOD__ . "($i)\n";
+               $i++;
+               if ($i >= 5) return 5;
+               return call_user_func_array(array("TestA", "doSomething"), 
array($i));
+       }
+
+       public function doSomethingThis($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               $i++;
+               if ($i >= 5) return 5;
+               return call_user_func_array(array($this, 
"TestA::doSomethingThis"), array($i));
+       }
+
+       public function doSomethingParent($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               $i++;
+               if ($i >= 5) return 5;
+               return call_user_func_array(array("parent", 
"doSomethingParent"), array($i));
+       }
+
+       public function doSomethingParentThis($i)
+       {
+               echo __METHOD__ . "($i)\n";
                $i++;
                if ($i >= 5) return 5;
-               return call_user_func_array(array("TestA","doSomething"), 
array($i));
+               return call_user_func_array(array($this, 
"parent::doSomethingParentThis"), array($i));
+       }
+
+       public static function doSomethingStatic($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               $i++;
+               if ($i >= 5) return 5;
+               return call_user_func_array(array("TestA", 
"doSomethingStatic"), array($i));
        }
 }
 
 $x = new TestB();
+echo "===A===\n";
 var_dump($x->doSomething(1));
+echo "\n===B===\n";
+var_dump($x->doSomethingThis(1));
+echo "\n===C===\n";
+var_dump($x->doSomethingParent(1));
+echo "\n===D===\n";
+var_dump($x->doSomethingParentThis(1));
+echo "\n===E===\n";
+var_dump($x->doSomethingStatic(1));
 
 ?>
 ===DONE===
+<?php exit(0); ?>
 --EXPECTF--
-TestB::doSomething(Object id #%d)
-TestA::doSomething(Object id #%d)
+===A===
+TestB::doSomething(1)
+
+Strict Standards: Non-static method TestA::doSomething() canot be called 
statically, assuming $this from compatible context TestB in %sbug32290.php on 
line %d
+TestA::doSomething(2)
+int(1)
+
+===B===
+TestB::doSomethingThis(1)
+TestA::doSomethingThis(2)
+int(1)
+
+===C===
+TestB::doSomethingParent(1)
+
+Strict Standards: Non-static method TestA::doSomethingParent() canot be called 
statically, assuming $this from compatible context TestB in %sbug32290.php on 
line %d
+TestA::doSomethingParent(2)
+int(1)
+
+===D===
+TestB::doSomethingParentThis(1)
+TestA::doSomethingParentThis(2)
+int(1)
+
+===E===
+TestB::doSomethingStatic(1)
+TestA::doSomethingStatic(2)
 int(1)
 ===DONE===
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/general_functions/bug32647.phpt?r1=1.1&r2=1.1.6.1&diff_format=u
Index: php-src/ext/standard/tests/general_functions/bug32647.phpt
diff -u php-src/ext/standard/tests/general_functions/bug32647.phpt:1.1 
php-src/ext/standard/tests/general_functions/bug32647.phpt:1.1.6.1
--- php-src/ext/standard/tests/general_functions/bug32647.phpt:1.1      Thu Apr 
21 14:17:52 2005
+++ php-src/ext/standard/tests/general_functions/bug32647.phpt  Fri Dec 16 
22:19:02 2005
@@ -1,14 +1,14 @@
 --TEST--
 Bug #32647 (Using register_shutdown_function() with invalid callback can crash 
PHP)
 --INI--
-error_reporting=2047
+error_reporting=4095
 display_errors=1
 --FILE--
 <?php
 
 function foo()
 {
-  echo "joo!\n";
+  echo "foo!\n";
 }
 
 class bar
@@ -23,9 +23,9 @@
 register_shutdown_function(array(0,""));               // Invalid
 register_shutdown_function(array('bar','foo'));        // Invalid
 register_shutdown_function(array(0,"some string"));    // Invalid
-register_shutdown_function('bar');                     // Valid
+register_shutdown_function('bar');                     // Invalid
 register_shutdown_function('foo');                     // Valid
-register_shutdown_function(array('bar','barfoo'));     // Valid
+register_shutdown_function(array('bar','barfoo'));     // Invalid
 
 $obj = new bar;
 register_shutdown_function(array($obj,'foobar'));      // Invalid
@@ -45,11 +45,13 @@
 
 Warning: register_shutdown_function(): Invalid shutdown callback 'Array' 
passed in %s on line %d
 
-Warning: (Registered shutdown functions) Unable to call bar::foo() - function 
does not exist in Unknown on line 0
+Strict Standards: Non-static method bar::barfoo() cannot be called statically 
in %sbug32647.php on line %d
 
-Warning: (Registered shutdown functions) Unable to call bar() - function does 
not exist in Unknown on line 0
-joo!
-bar!
+Warning: register_shutdown_function(): Invalid shutdown callback 'bar::foobar' 
passed in %sbug32647.php on line %d
+foo!
+
+Strict Standards: Non-static method bar::barfoo() cannot be called statically 
in Unknown on line 0
 
-Warning: (Registered shutdown functions) Unable to call bar::foobar() - 
function does not exist in Unknown on line 0
+Strict Standards: Non-static method bar::barfoo() cannot be called statically 
in Unknown on line 0
+bar!
 bar!
http://cvs.php.net/viewcvs.cgi/php-src/tests/classes/bug27504.phpt?r1=1.1&r2=1.1.4.1&diff_format=u
Index: php-src/tests/classes/bug27504.phpt
diff -u php-src/tests/classes/bug27504.phpt:1.1 
php-src/tests/classes/bug27504.phpt:1.1.4.1
--- php-src/tests/classes/bug27504.phpt:1.1     Tue Mar 16 16:45:44 2004
+++ php-src/tests/classes/bug27504.phpt Fri Dec 16 22:19:02 2005
@@ -20,5 +20,6 @@
 --EXPECTF--
 Called function foo:bar(%d)
 
-Fatal error: Call to private method foo::bar() from context '' in %s on line 13
+Warning: call_user_func_array(): First argument is expected to be a valid 
callback, 'foo::bar' was given in %sbug27504.php on line %d
 
+Fatal error: Call to private method foo::bar() from context '' in %s on line %d

http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/tests/spl_autoload_007.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/spl_autoload_007.phpt
+++ php-src/ext/spl/tests/spl_autoload_007.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to