/** * Test the autoloading function alf by loading different * types of classes. * @small */ public function testAutoloading() { // default path $p = "src"; // create an AutLoader with initiaization disabled // to set testing state first and initialize it manually $al = new \core\AutoLoader(false, $p); $al->sett(true); $al->load(); // run tests/assertions for a testing state $this->alt($al); // run same tests/assertions for a non testing state $al->unload(); $al->sett(false); $al->expand(".class.php,.include.php,.interface.php,.test.class.php,.inc,.php"); $al->load(); $this->alt($al); $al = null; }
/** * Test the state setting. * @small */ public function testStateModification() { $al = new \core\AutoLoader(); $this->assertEquals(false, $al->gett()); $al->sett(null); $this->assertEquals(false, $al->gett()); $al->sett(false); $this->assertEquals(false, $al->gett()); $al->sett(true); $this->assertEquals(true, $al->gett()); $al = null; }