pajoye Mon Mar 1 15:40:51 2004 EDT Added files: /php-src/tests/reflection exception.php invoke.phpt Log: - initial release, reflection tests suite
http://cvs.php.net/co.php/php-src/tests/reflection/exception.php?r=1.1&p=1 Index: php-src/tests/reflection/exception.php +++ php-src/tests/reflection/exception.php <?php class reflectionException extends reflection_exception { function MyException($_errno, $_errmsg) { $this->errno = $_errno; $this->errmsg = $_errmsg; } function getErrno() { return $this->errno; } function getErrmsg() { return $this->errmsg; } } ?> http://cvs.php.net/co.php/php-src/tests/reflection/invoke.phpt?r=1.1&p=1 Index: php-src/tests/reflection/invoke.phpt +++ php-src/tests/reflection/invoke.phpt --TEST-- invoke with non object or null value --FILE-- <?php include_once dirname(__FILE__).'/exception.php'; class a { function a(){ } } class b { } $b = new b(); $a=new Reflection_Class("a"); $m=$a->getMethod("a"); try { $m->invoke(null); } catch (reflection_exception $E) { echo $E->getMessage()."\n"; } try { $m->invoke($b); } catch (reflection_exception $E) { echo $E->getMessage()."\n"; } $b = new a(); try { $m->invoke($b); } catch (reflection_exception $E) { echo $E->getMessage()."\n"; } echo "===DONE===\n";?> --EXPECT-- Non-object passed to Invoke() Given object is not an instance of the class this method was declared in ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php