1 <?php 2 3 require "tests.php"; 4 5 // No new functions 6 check::functions(array()); 7 8 check::classes(array('Foo','Spam')); 9 10 // No new vars 11 check::globals(array()); 12 13 // We shouldn't be able to instantiate abstract class Foo. 14 $class = 'Foo'; 15 try { 16 $obj = eval("new $class();"); 17 check::fail("Should not be able to instantiate abstract class $class"); 18 } catch (Error $e) { 19 check::equal($e->getMessage(), "Cannot instantiate abstract class $class", "Unexpected exception: {$e->getMessage()}"); 20 } 21 22 $spam=new Spam(); 23 check::equal(0,$spam->blah(),"spam object method"); 24 25 check::done();