示例#1
0
 /**
  * Sets the test up by loading the DI container and other stuff
  *
  * @return Phalcon\DI
  */
 protected function setUp()
 {
     parent::setUp();
     // Set the dispatcher
     $this->di->set('dispatcher', function () {
         $dispatcher = new PhDispatcher();
         $dispatcher->setControllerName('test');
         $dispatcher->setActionName('empty');
         $dispatcher->setParams(array());
         return $dispatcher;
     });
     $this->di->set('escaper', function () {
         return new PhEscaper();
     });
 }
示例#2
0
 /**
  * Sets the test up by loading the DI container and other stuff
  *
  * @param  \Phalcon\DiInterface $di
  * @param  \Phalcon\Config      $config
  * @return void
  */
 protected function setUp(\Phalcon\DiInterface $di = null, \Phalcon\Config $config = null)
 {
     parent::setUp($di, $config);
     // Set the dispatcher
     $this->di->setShared('dispatcher', function () {
         $dispatcher = new PhDispatcher();
         $dispatcher->setControllerName('test');
         $dispatcher->setActionName('empty');
         $dispatcher->setParams(array());
         return $dispatcher;
     });
     $this->di->set('escaper', function () {
         return new PhEscaper();
     });
     if ($this->di instanceof \Phalcon\DiInterface) {
         $this->application = new PhApplication($this->di);
     }
 }
示例#3
0
 /**
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     // Set the dispatcher
     $this->di->setShared('dispatcher', function () {
         $dispatcher = new PhDispatcher();
         $dispatcher->setControllerName('test');
         $dispatcher->setActionName('empty');
         $dispatcher->setParams([]);
         return $dispatcher;
     });
     $this->di->set('escaper', function () {
         return new PhEscaper();
     });
     if ($this->di instanceof DiInterface) {
         $this->application = new PhApplication($this->di);
     }
 }