diff options
author | Marcus Boerger <helly@php.net> | 2004-09-26 18:16:33 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-09-26 18:16:33 +0000 |
commit | 617de199125d605f41ea9c7e182740ba40557c63 (patch) | |
tree | cb10f28e05d59eff12a723db187b7f36c5b4146b /tests | |
parent | 429b37d750627d6d1f72acc8535540dec0d0b071 (diff) | |
download | php-git-617de199125d605f41ea9c7e182740ba40557c63.tar.gz |
- Add new test (related to #30234)
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/classes/autoload_006.phpt | 40 | ||||
-rwxr-xr-x | tests/classes/autoload_implements.p5c | 10 | ||||
-rwxr-xr-x | tests/classes/autoload_interface.p5c | 7 |
3 files changed, 57 insertions, 0 deletions
diff --git a/tests/classes/autoload_006.phpt b/tests/classes/autoload_006.phpt new file mode 100755 index 0000000000..9af6fc9829 --- /dev/null +++ b/tests/classes/autoload_006.phpt @@ -0,0 +1,40 @@ +--TEST-- +ZE2 Autoload from destructor +--SKIPIF-- +<?php + if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); + if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); +?> +--FILE-- +<?php + +function __autoload($class_name) +{ + require_once(dirname(__FILE__) . '/' . strtolower($class_name) . '.p5c'); + echo __FUNCTION__ . '(' . $class_name . ")\n"; +} + +var_dump(interface_exists('autoload_interface', false)); +var_dump(class_exists('autoload_implements', false)); + +$o = new Autoload_Implements; +var_dump($o); +var_dump($o instanceof autoload_interface); +unset($o); + +var_dump(interface_exists('autoload_interface', false)); +var_dump(class_exists('autoload_implements', false)); + +?> +===DONE=== +--EXPECTF-- +bool(false) +bool(false) +__autoload(autoload_interface) +__autoload(Autoload_Implements) +object(autoload_implements)#%d (0) { +} +bool(true) +bool(true) +bool(true) +===DONE=== diff --git a/tests/classes/autoload_implements.p5c b/tests/classes/autoload_implements.p5c new file mode 100755 index 0000000000..2c3479c860 --- /dev/null +++ b/tests/classes/autoload_implements.p5c @@ -0,0 +1,10 @@ +<?php + +class autoload_implements implements autoload_interface { + function testFunction() + { + return true; + } +} + +?>
\ No newline at end of file diff --git a/tests/classes/autoload_interface.p5c b/tests/classes/autoload_interface.p5c new file mode 100755 index 0000000000..6908155e61 --- /dev/null +++ b/tests/classes/autoload_interface.p5c @@ -0,0 +1,7 @@ +<?php + +interface autoload_interface { + function testFunction(); +} + +?>
\ No newline at end of file |