- initial release, reflection tests suite

This commit is contained in:
Pierre Joye 2004-03-01 20:40:51 +00:00
parent 03bdd13560
commit 6f68407894
2 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,16 @@
<?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;
}
}
?>

View File

@ -0,0 +1,44 @@
--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===