/** * Setup Icinga class loader * * @return $this */ public function setupAutoloader() { require $this->libDir . '/Icinga/Application/ClassLoader.php'; $this->loader = new ClassLoader(); $this->loader->registerNamespace('Icinga', $this->libDir . '/Icinga'); $this->loader->register(); return $this; }
public function testClassLoad() { $classFile = $this->baseDir . self::$classFile; $this->assertFileExists($classFile); $loader = new ClassLoader(); $loader->registerNamespace('My\\Library', dirname($classFile)); $loader->register(); $o = new \My\Library\TestStruct(); $this->assertTrue($o->testFlag()); }