Add vim modelines to all files.
[htmlpurifier.git] / tests / HTMLPurifier / PHPT / loading / error-auto-with-spl-nonstatic-autoload.phpt
blob6dfd50624fc6fa4c6fb4afc5b3facb6228ca555e
1 --TEST--
2 Error when registering autoload with non-static autoload already on SPL stack
3 --SKIPIF--
4 <?php
5 if (!function_exists('spl_autoload_register')) {
6     echo "skip - spl_autoload_register() not available";
8 --FILE--
9 <?php
10 class NotStatic
12     public function autoload($class) {
13         echo "Autoloading... $class" . PHP_EOL;
14         eval("class $class {}");
15     }
18 $obj = new NotStatic();
19 spl_autoload_register(array($obj, 'autoload'));
21 try {
22     require '../library/HTMLPurifier.auto.php';
23 } catch (Exception $e) {
24     echo 'Caught error gracefully';
25     assert('strpos($e->getMessage(), "44144") !== false');
28 --EXPECT--
29 Caught error gracefully