public function testExecuteAjaxRequest() { $name = 'test-name'; $renderedData = '<html>data</html>'; $this->requestMock->expects($this->any())->method('getParam')->with('namespace')->willReturn($name); $this->requestMock->expects($this->any())->method('getParams')->willReturn([]); $this->responseMock->expects($this->once())->method('appendBody')->with($renderedData); /** * @var \Magento\Framework\View\Element\UiComponentInterface|\PHPUnit_Framework_MockObject_MockObject $viewMock */ $viewMock = $this->getMockForAbstractClass('Magento\\Framework\\View\\Element\\UiComponentInterface', [], '', false, true, true, ['render']); $viewMock->expects($this->once())->method('render')->willReturn($renderedData); $viewMock->expects($this->once())->method('getChildComponents')->willReturn([]); $this->uiFactoryMock->expects($this->once())->method('create')->willReturn($viewMock); $this->render->executeAjaxRequest(); }
/** * {@inheritdoc} */ public function executeAjaxRequest() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'executeAjaxRequest'); if (!$pluginInfo) { return parent::executeAjaxRequest(); } else { return $this->___callPlugins('executeAjaxRequest', func_get_args(), $pluginInfo); } }