public function testProcessRequestTrue() { $response = new Zend_Controller_Response_Http(); $response->setBody('Initial response body.'); $this->_requestProcessor->expects($this->any())->method('extractContent')->will($this->returnValue('Additional response text.')); $this->assertTrue($this->_model->processRequest($response)); $this->assertEquals('Initial response body.Additional response text.', $response->getBody()); }
public function testProcessRequestTrue() { /** if (!Magento_Test_Bootstrap::canTestHeaders()) { $this->markTestSkipped('Test requires to send headers.'); } */ $model = new Mage_Core_Model_Cache(array('request_processors' => array('Mage_Core_Model_CacheTestRequestProcessor'))); Mage_Core_Model_CacheTestRequestProcessor::$isEnabled = true; $this->assertTrue($model->processRequest()); }
/** * Run application. Run process responsible for request processing and sending response. * List of supported parameters: * scope_code - code of default scope (website/store_group/store code) * scope_type - type of default scope (website/group/store) * options - configuration options * * @param array $params application run parameters * @return Mage_Core_Model_App */ public function run($params) { $options = isset($params['options']) ? $params['options'] : array(); Magento_Profiler::start('init'); $this->baseInit($options); Mage::register('application_params', $params); Magento_Profiler::stop('init'); if ($this->_cache->processRequest()) { $this->getResponse()->sendResponse(); } else { Magento_Profiler::start('init'); $this->_initModules(); $this->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS); if ($this->_config->isLocalConfigLoaded()) { $scopeCode = isset($params['scope_code']) ? $params['scope_code'] : ''; $scopeType = isset($params['scope_type']) ? $params['scope_type'] : 'store'; $this->_initCurrentStore($scopeCode, $scopeType); $this->_initRequest(); Mage_Core_Model_Resource_Setup::applyAllDataUpdates(); } $controllerFront = $this->getFrontController(); Magento_Profiler::stop('init'); $controllerFront->dispatch(); } return $this; }