Beispiel #1
0
 public function testSetDefaultController()
 {
     $this->dispatcher = Yaf_Dispatcher::getInstance();
     $this->assertEquals('Index', $this->readAttribute($this->dispatcher, '_default_controller'));
     $this->dispatcher->setDefaultController('test');
     $this->assertEquals('Test', $this->readAttribute($this->dispatcher, '_default_controller'));
     //set back to index
     $this->dispatcher->setDefaultController('index');
 }
 /**
  * Singleton instance
  *
  * @return Yaf_Dispatcher
  */
 public static function getInstance()
 {
     if (null === self::$_instance) {
         self::$_instance = new self();
         self::$_instance->setDefaultAction(Yaf_G::get('default_action'));
         self::$_instance->setDefaultController(Yaf_G::get('default_controller'));
         self::$_instance->setDefaultModule(Yaf_G::get('default_module'));
         self::$_instance->_router = new Yaf_Router();
     }
     return self::$_instance;
 }