Ejemplo n.º 1
0
 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());
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 3
0
 /**
  * {@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);
     }
 }
Ejemplo n.º 4
0
 /**
  * {@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);
     }
 }