예제 #1
0
파일: Cli.php 프로젝트: kandy/system
 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     if (!$request instanceof System_Controller_Request_Cli) {
         throw new Zend_Controller_Action_Exception('Must run from console');
     }
     parent::__construct($request, $response, $invokeArgs);
     $this->getHelper('viewRenderer')->setNoRender();
 }
예제 #2
0
파일: Json.php 프로젝트: kandy/system
 /**
  * @param Zend_Controller_Request_Abstract $request
  * @param Zend_Controller_Response_Abstract $response
  * @param array $invokeArgs Any additional invocation arguments
  * @return void
  */
 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     parent::__construct($request, $response, $invokeArgs);
     $smartyStack = Zend_Controller_Front::getInstance()->getPlugin('System_Controller_Plugin_SmartyStack');
     if ($smartyStack instanceof System_Controller_Plugin_SmartyStack) {
         $smartyStack->disablePlugin();
     }
     $this->view = new System_View_Json();
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($this->view);
     $response->setHeader('Content-type', 'text/javascript', true);
 }
예제 #3
0
 public function testGetTable()
 {
     $tableMock = $this->getMock('Model_Table_User');
     System_Locator_TableLocator::getInstance()->set('User', $tableMock);
     self::assertEquals($tableMock, $this->_object->getTable('User'));
 }