PHP: detect if a non-object is passed to check::classname() in the testsuite

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11505 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Miklos Vajna 2009-08-05 12:37:56 +00:00
commit 5161a12868

View file

@ -70,6 +70,8 @@ class check {
}
function classname($string,$object) {
if (!is_object($object))
return check::fail("The second argument is a " . gettype($object) . ", not an object.");
if (strtolower($string)!=strtolower($classname=get_class($object))) return check::fail("Object: \$object is of class %s not class %s",$classname,$string);
return TRUE;
}