helly Tue Nov 6 15:29:32 2007 UTC Modified files: /php-src/ext/spl/tests bug38325.phpt bug40091.phpt bug40442.phpt Log: - MFB Add tests http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug38325.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/spl/tests/bug38325.phpt diff -u /dev/null php-src/ext/spl/tests/bug38325.phpt:1.2 --- /dev/null Tue Nov 6 15:29:32 2007 +++ php-src/ext/spl/tests/bug38325.phpt Tue Nov 6 15:29:32 2007 @@ -0,0 +1,11 @@ +--TEST-- +Bug #38325 (spl_autoload_register() gaves wrong line for "class not found") +--SKIPIF-- +<?php if (!extension_loaded("spl")) print "skip"; ?> +--FILE-- +<?php +spl_autoload_register(); +new Foo(); +?> +--EXPECTF-- +Fatal error: spl_autoload(): Class Foo could not be loaded in %s on line 3 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug40091.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/spl/tests/bug40091.phpt diff -u /dev/null php-src/ext/spl/tests/bug40091.phpt:1.2 --- /dev/null Tue Nov 6 15:29:32 2007 +++ php-src/ext/spl/tests/bug40091.phpt Tue Nov 6 15:29:32 2007 @@ -0,0 +1,39 @@ +--TEST-- +Bug #40091 (issue with spl_autoload_register() and 2 instances of the same class) +--SKIPIF-- +<?php if (!extension_loaded("spl")) print "skip"; ?> +--FILE-- +<?php +class MyAutoloader { + function __construct($directory_to_use) {} + function autoload($class_name) { + // code to autoload based on directory + } +} + +$autloader1 = new MyAutoloader('dir1'); +spl_autoload_register(array($autloader1, 'autoload')); + +$autloader2 = new MyAutoloader('dir2'); +spl_autoload_register(array($autloader2, 'autoload')); + +print_r(spl_autoload_functions()); +?> +===DONE=== +--EXPECT-- +Array +( + [0] => Array + ( + [0] => MyAutoloader + [1] => autoload + ) + + [1] => Array + ( + [0] => MyAutoloader + [1] => autoload + ) + +) +===DONE=== http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug40442.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/spl/tests/bug40442.phpt diff -u /dev/null php-src/ext/spl/tests/bug40442.phpt:1.2 --- /dev/null Tue Nov 6 15:29:32 2007 +++ php-src/ext/spl/tests/bug40442.phpt Tue Nov 6 15:29:32 2007 @@ -0,0 +1,12 @@ +--TEST-- +Bug #40442 (ArrayObject::offsetExists broke in 5.2.1, works in 5.2.0) +--FILE-- +<?php +$a = new ArrayObject(); +$a->offsetSet('property', 0); +var_dump($a->offsetExists('property')); +?> +===DONE=== +--EXPECT-- +bool(true) +===DONE===
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php