Пример #1
0
 /**
  * @test
  */
 public function autoloadSpecifiedClassesBeforeStartingTheSession()
 {
     $class = 'Piece_Unity_SessionTest_AutoloadClass';
     $oldIncludePath = set_include_path(dirname(__FILE__) . '/../..' . PATH_SEPARATOR . get_include_path());
     Piece_Unity_Session::addAutoloadClass($class);
     @$this->_session->start();
     $found = class_exists($class, false);
     $this->assertTrue($found);
     set_include_path($oldIncludePath);
 }
 /**
  * Sets autoload classes.
  */
 function _setAutoloadClasses()
 {
     $autoloadClasses = $this->_getConfiguration('autoloadClasses');
     if (!is_array($autoloadClasses)) {
         trigger_error('Failed to configure the configuration point [ autoloadClasses ] at the plugin [ ' . __CLASS__ . ' ].', E_USER_WARNING);
         $autoloadClasses = array();
     }
     $autoloadClasses[] = 'Piece_Flow_Continuation';
     $autoloadClasses[] = 'Piece_Right_Results';
     foreach ($autoloadClasses as $autoloadClass) {
         Piece_Unity_Session::addAutoloadClass($autoloadClass);
     }
 }