/** * {@inheritdoc} */ public function renderResult(\Magento\Framework\App\ResponseInterface $response) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'renderResult'); if (!$pluginInfo) { return parent::renderResult($response); } else { return $this->___callPlugins('renderResult', func_get_args(), $pluginInfo); } }
/** * @magentoDataFixture Magento/Catalog/_files/multiple_products.php * @magentoAppIsolation enabled * @magentoAppArea frontend */ public function testPrepareAndRender() { // need for \Magento\Review\Block\Form::getProductInfo() $this->objectManager->get('Magento\\Framework\\App\\RequestInterface')->setParam('id', 10); $this->_helper->prepareAndRender($this->page, 10, $this->_controller); /** @var \Magento\TestFramework\Response $response */ $response = $this->objectManager->get('Magento\\TestFramework\\Response'); $this->page->renderResult($response); $this->assertNotEmpty($response->getBody()); $this->assertEquals(10, $this->objectManager->get('Magento\\Catalog\\Model\\Session')->getLastViewedProductId()); }
/** * Rendering layout * * @param string $output * @return $this */ public function renderLayout($output = '') { if ($this->_actionFlag->get('', 'no-renderLayout')) { return $this; } \Magento\Framework\Profiler::start('LAYOUT'); \Magento\Framework\Profiler::start('layout_render'); if ('' !== $output) { $this->getLayout()->addOutputElement($output); } $this->_eventManager->dispatch('controller_action_layout_render_before'); $this->_eventManager->dispatch('controller_action_layout_render_before_' . $this->_request->getFullActionName()); $this->page->renderResult($this->_response); \Magento\Framework\Profiler::stop('layout_render'); \Magento\Framework\Profiler::stop('LAYOUT'); return $this; }