Exemplo n.º 1
0
 /**
  * Test if objects are being passed the service locator
  */
 function testServiceLocatorAwareMustBeGivenServiceLocator()
 {
     $this->request->setPost(new Parameters(array('extAction' => 'KJSenchaTestAsset.Direct.ServiceAction', 'extMethod' => 'getServiceResult', 'extTID' => 0, 'extModule' => null)));
     $this->controller->setDebugMode(true);
     $result = $this->controller->dispatch($this->request);
     $this->assertEquals('pong!', $result->result);
 }
 /**
  * @covers \KJSencha\Controller\DirectController::setDebugMode
  * @covers \KJSencha\Controller\DirectController::isDebugMode
  */
 function testShowErrorResponseWhenDebugModeIsOn()
 {
     $this->request->setPost(new Parameters(array('extAction' => 'KJSenchaTestAsset.Direct.ErrorGenerator', 'extMethod' => 'throwException', 'extTID' => 0, 'extModule' => null)));
     $this->controller->setDebugMode(true);
     $result = $this->controller->dispatch($this->request);
     $this->assertEquals('exception', $result->type);
     $this->assertEquals('Exception!', $result->message);
     $this->assertNotEmpty($result->where);
 }