/** * {@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 testPopupActionWithProductIdNoSetId() { $storeId = 12; $typeId = 4; $setId = 0; $productId = 399; $product = $this->getMock('Magento\\Catalog\\Model\\Product', ['setStoreId', 'setTypeId', 'setData', 'load', '__wakeup'], [], '', false); $this->request->expects($this->at(0))->method('getParam')->with('id')->will($this->returnValue($productId)); $this->factory->expects($this->once())->method('create')->will($this->returnValue($product)); $this->request->expects($this->at(1))->method('getParam')->with('store', 0)->will($this->returnValue($storeId)); $product->expects($this->once())->method('setStoreId')->with($storeId); $this->request->expects($this->at(2))->method('getParam')->with('type')->will($this->returnValue($typeId)); $product->expects($this->never())->method('setTypeId'); $product->expects($this->once())->method('setData')->with('_edit_mode', true); $product->expects($this->once())->method('load')->with($productId); $this->request->expects($this->at(3))->method('getParam')->with('set')->will($this->returnValue($setId)); $this->registry->expects($this->once())->method('register')->with('current_product', $product); $this->view->expects($this->once())->method('loadLayout')->with(false); $this->view->expects($this->once())->method('renderLayout'); $this->action->execute(); }