public function testAroundDispatch()
 {
     $subjectMock = $this->getMock('Magento\\Framework\\App\\Action\\Action', [], [], '', false);
     $designLoaderMock = $this->getMock('Magento\\Framework\\View\\DesignLoader', [], [], '', false);
     $requestMock = $this->getMock('Magento\\Framework\\App\\RequestInterface');
     $plugin = new \Magento\Framework\App\Action\Plugin\Design($designLoaderMock);
     $designLoaderMock->expects($this->once())->method('load');
     $plugin->beforeDispatch($subjectMock, $requestMock);
 }
Example #2
0
 public function testAroundDispatch()
 {
     $subjectMock = $this->getMock('Magento\\Framework\\App\\Action\\Action', [], [], '', false);
     $designLoaderMock = $this->getMock('Magento\\Framework\\View\\DesignLoader', [], [], '', false);
     $closureMock = function () {
         return 'Expected';
     };
     $requestMock = $this->getMock('Magento\\Framework\\App\\RequestInterface');
     $plugin = new \Magento\Framework\App\Action\Plugin\Design($designLoaderMock);
     $designLoaderMock->expects($this->once())->method('load');
     $this->assertEquals('Expected', $plugin->aroundDispatch($subjectMock, $closureMock, $requestMock));
 }