Пример #1
0
 /**
  */
 public function testGetActions()
 {
     $this->assertEquals($this->object, $this->object->register('TestAction', new Action\CallableActionProxy(function () {
         return 'test';
     })));
     $this->assertEquals(1, count($this->object->getActions()));
 }
Пример #2
0
 /**
  * Adds Actions and Listeners to the Application
  *
  * @param Application $app The running Application
  *
  * @return void
  */
 public function load(Application $app)
 {
     $app->register('PageView', ProxyFactory::factory('Nitronet\\Fwk\\CMF\\Controllers\\PageView:show'));
     $console = $this->cfg('consoleService', false);
     if ($console) {
         $app->addListener(new CommandsListener($this->cfg('consoleService', 'console'), $this->cfg('serviceName', 'cmf')));
     }
 }
Пример #3
0
 public function testDirectResponse()
 {
     $rsp = new \Symfony\Component\HttpFoundation\Response();
     $this->object->register('TestDirectResponse', ProxyFactory::factory(function () use($rsp) {
         return $rsp;
     }));
     $request = Request::create('/TestDirectResponse.action');
     $response = $this->object->run($request);
     $this->assertEquals($rsp, $response);
 }
Пример #4
0
 /**
  * Adds Actions and Listeners to the Application
  *
  * @param Application $app The running Application
  *
  * @return void
  */
 public function load(Application $app)
 {
     $app->register('CommentsThread', PF::factory('Nitronet\\Fwk\\Comments\\Controllers\\Thread:show'));
     $app->register('CommentsCount', PF::factory('Nitronet\\Fwk\\Comments\\Controllers\\Thread:countComments'));
     $app->register('CommentPost', PF::factory('Nitronet\\Fwk\\Comments\\Controllers\\Comment:post'));
 }
Пример #5
0
 public function load(Application $app)
 {
     $app->register($this->cfg('action', 'Asset'), PF::factory($this->cfg('controller', 'Nitronet\\Fwk\\Assetic\\Controllers\\AssetAction:show')));
 }