pickles/vendors/php-test-helpers/tests/set_new_overload_static_method.phpt
Joshua Sherman 8f3c623e5d Added php-test-helpers to the vendors directory
Seemed easier than trying to figure out how to force the prompt to accept the
unknown IP (perhaps not possible at all as it is part of SSH?). `yes` didn't
work, unfortunately.
2014-01-12 16:25:52 -05:00

23 lines
436 B
PHP
Executable file

--TEST--
A static method can be registered as a callback with set_new_overload()
--SKIPIF--
<?php
if (!extension_loaded('test_helpers')) die('skip test_helpers extension not loaded');
?>
--FILE--
<?php
class Foo {}
class Bar {}
class CB {
static function callback($className) {
return 'Foo';
}
}
var_dump(set_new_overload(array('CB', 'callback')));
var_dump(get_class(new Bar));
--EXPECT--
bool(true)
string(3) "Foo"