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(); }
/** * @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); }
public function testGetTable() { $tableMock = $this->getMock('Model_Table_User'); System_Locator_TableLocator::getInstance()->set('User', $tableMock); self::assertEquals($tableMock, $this->_object->getTable('User')); }