public function testExecute()
 {
     $name = 'test-name';
     $renderedData = '<html>data</html>';
     $this->requestMock->expects($this->at(0))->method('getParam')->with('component')->willReturn($name);
     $this->requestMock->expects($this->at(1))->method('getParam')->with('name')->willReturn($name);
     $this->responseMock->expects($this->once())->method('appendBody')->with($renderedData);
     $viewMock = $this->getMock('Magento\\Ui\\Form\\Field', ['render'], [], '', false);
     $viewMock->expects($this->once())->method('render')->willReturn($renderedData);
     $this->uiFactoryMock->expects($this->once())->method('createUiComponent')->willReturn($viewMock);
     $this->assertNull($this->render->execute());
 }
Beispiel #2
0
 public function testExecute()
 {
     $name = 'test-name';
     $renderedData = '<html>data</html>';
     $this->requestMock->expects($this->at(0))->method('getParam')->with('namespace')->willReturn($name);
     $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);
     $this->uiFactoryMock->expects($this->once())->method('create')->willReturn($viewMock);
     $this->render->execute();
 }
 /**
  * {@inheritdoc}
  */
 public function dispatch(\Magento\Framework\App\RequestInterface $request)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'dispatch');
     if (!$pluginInfo) {
         return parent::dispatch($request);
     } else {
         return $this->___callPlugins('dispatch', func_get_args(), $pluginInfo);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function getResponse()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getResponse');
     if (!$pluginInfo) {
         return parent::getResponse();
     } else {
         return $this->___callPlugins('getResponse', func_get_args(), $pluginInfo);
     }
 }