/** * {@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); } }
public function testExecuteBadSecretKey() { $this->itemOptionMock->expects($this->once())->method('load')->willReturnSelf(); $this->itemOptionMock->expects($this->once())->method('getId')->willReturn(self::OPTION_ID); $this->itemOptionMock->expects($this->any())->method('getCode')->willReturn(self::OPTION_CODE); $this->itemOptionMock->expects($this->any())->method('getProductId')->willReturn(self::OPTION_PRODUCT_ID); $this->itemOptionMock->expects($this->any())->method('getValue')->willReturn(self::OPTION_VALUE); $this->productOptionMock->expects($this->once())->method('load')->willReturnSelf(); $this->productOptionMock->expects($this->any())->method('getId')->willReturn(self::OPTION_ID); $this->productOptionMock->expects($this->any())->method('getProductId')->willReturn(self::OPTION_PRODUCT_ID); $this->productOptionMock->expects($this->any())->method('getType')->willReturn(self::OPTION_TYPE); $this->unserializeMock->expects($this->once())->method('unserialize')->with(self::OPTION_VALUE)->willReturn([self::SECRET_KEY => 'bad_test_secret_key']); $this->resultForwardMock->expects($this->once())->method('forward')->with('noroute')->willReturn(true); $this->objectMock->execute(); }