Ejemplo n.º 1
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);
     }
 }
 /**
  * @param int $blockId
  * @param string $label
  * @param string $title
  * @dataProvider editActionData
  */
 public function testEditAction($blockId, $label, $title)
 {
     $this->requestMock->expects($this->once())->method('getParam')->with('block_id')->willReturn($blockId);
     $this->blockMock->expects($this->any())->method('load')->with($blockId);
     $this->blockMock->expects($this->any())->method('getId')->willReturn($blockId);
     $this->blockMock->expects($this->any())->method('getTitle')->willReturn('Test title');
     $this->coreRegistryMock->expects($this->once())->method('register')->with('cms_block', $this->blockMock);
     $resultPageMock = $this->getMock('Magento\\Backend\\Model\\View\\Result\\Page', [], [], '', false);
     $this->resultPageFactoryMock->expects($this->once())->method('create')->willReturn($resultPageMock);
     $titleMock = $this->getMock('Magento\\Framework\\View\\Page\\Title', [], [], '', false);
     $titleMock->expects($this->at(0))->method('prepend')->with(__('Blocks'));
     $titleMock->expects($this->at(1))->method('prepend')->with($this->getTitle());
     $pageConfigMock = $this->getMock('Magento\\Framework\\View\\Page\\Config', [], [], '', false);
     $pageConfigMock->expects($this->exactly(2))->method('getTitle')->willReturn($titleMock);
     $resultPageMock->expects($this->once())->method('setActiveMenu')->willReturnSelf();
     $resultPageMock->expects($this->any())->method('addBreadcrumb')->willReturnSelf();
     $resultPageMock->expects($this->at(3))->method('addBreadcrumb')->with(__($label), __($title))->willReturnSelf();
     $resultPageMock->expects($this->exactly(2))->method('getConfig')->willReturn($pageConfigMock);
     $this->assertSame($resultPageMock, $this->editController->execute());
 }
Ejemplo n.º 3
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);
     }
 }