public function testObject()
 {
     $obj = new SplClassLoader(SYNERGY_ROOT_DIR . DIRECTORY_SEPARATOR . 'app');
     $this->assertEquals(SYNERGY_ROOT_DIR . DIRECTORY_SEPARATOR . 'app', $obj->getIncludePath());
     $obj->register();
     $obj->unregister();
 }
Example #2
0
 /**
  * directory where the app data lives
  *
  * @param string $dir directory where the app data live
  *
  * @return void
  * @throws InvalidArgumentException
  */
 public function setAppDir($dir)
 {
     if (!is_dir($dir) && !Tools::mkdir($dir, true)) {
         throw new InvalidArgumentException(sprintf("Invalid App directory, %s", $dir));
     } else {
         if (!is_readable($dir)) {
             throw new InvalidArgumentException(sprintf("App Directory %s not readable", $dir));
         } else {
             $this->app_dir = $dir;
             $classLoader = new SplClassLoader($dir);
             $classLoader->register();
         }
     }
 }