Example #1
0
 /**
  * @expectedException RuntimeException
  */
 public function testControllerActionLogicException()
 {
     $app = new App(['timezone' => 'UTC'], 'test-action');
     $app->route()->setParam('controller', 'foo');
     $app->route()->setParam('action', '');
     $stub = $this->getMock(Controller::class, ['indexAction', 'controllerAction'], [$app]);
     $stub->method('controllerAction')->willReturn(true);
     $foo = new FooController($app);
     $this->assertEquals($stub->controllerAction(), $foo->testAction());
 }
Example #2
0
 /**
  * Create respective class instances for controller usage.
  * Mapped and re-assign to the core instances.
  */
 protected function factory()
 {
     $this->request = $this->app->request();
     $this->response = $this->app->response();
     $this->route = $this->app->route();
     $this->view = $this->app->view();
     return $this;
 }
Example #3
0
 public function testSingletonRouteClassInstanceViaStaticMethod()
 {
     $this->assertEquals($this->app->route(), App::route());
 }
Example #4
0
 /**
  * Return requested action.
  */
 public function getAction()
 {
     return $this->app->route()->getParams('action');
 }