/**
  * Test if the autoloader throws an exception if the `exception` policy is set.
  *
  * @expectedException \com\mohiva\common\io\exceptions\ClassNotFoundException
  */
 public function testPolicyException()
 {
     $this->autoLoader = new ClassAutoloader();
     $this->autoLoader->setPolicy(ClassAutoloader::POLICY_EXCEPTION);
     $this->autoLoader->register();
     class_exists('NotExistingClass', true);
 }
Exemple #2
0
 /**
  * Setup the class autoloader for all mohiva related files.
  */
 private static function setupClassAutoloader()
 {
     /** @noinspection PhpIncludeInspection */
     require_once 'com/mohiva/common/io/ClassAutoloader.php';
     self::$autoloader = new ClassAutoloader();
     self::$autoloader->setPolicy(ClassAutoloader::POLICY_EXCEPTION);
     self::$autoloader->registerNamespace('com\\mohiva');
     self::$autoloader->register();
 }