[php] Add more checks to some PHP testcases
This commit is contained in:
parent
f04d741d1c
commit
cc5395a669
3 changed files with 28 additions and 2 deletions
|
|
@ -2,9 +2,24 @@
|
|||
|
||||
require "tests.php";
|
||||
|
||||
check::classes(array('Foo','Spam'));
|
||||
$spam=new Spam();
|
||||
// No new functions
|
||||
check::functions(array());
|
||||
|
||||
check::classes(array('Foo','Spam'));
|
||||
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
// We shouldn't be able to instantiate abstract class Foo.
|
||||
$class = 'Foo';
|
||||
try {
|
||||
$obj = eval("new $class();");
|
||||
check::fail("Should not be able to instantiate abstract class $class");
|
||||
} catch (Error $e) {
|
||||
check::equal($e->getMessage(), "Cannot instantiate abstract class $class", "Unexpected exception: {$e->getMessage()}");
|
||||
}
|
||||
|
||||
$spam=new Spam();
|
||||
check::equal(0,$spam->blah(),"spam object method");
|
||||
|
||||
check::done();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue