public function testAttributeSetIsObtainedFromGetWhenThereIsNoOneInPost() { $this->request->expects($this->any())->method('getParam')->willReturnMap([['set', null, 4]]); $this->request->expects($this->any())->method('getPost')->willReturnMap([['set', null, null]]); $this->product->expects($this->once())->method('setAttributeSetId')->with(4); $this->action->execute(); }
public function testInitializeFromData() { $productData = ['name' => 'test-name', 'stock_data' => ['use_config_manage_stock' => 0]]; $this->request->expects($this->any())->method('getPost')->willReturnMap([['product', [], $productData]]); $this->initializationHelper->expects($this->once())->method('initializeFromData')->with($this->product, $productData)->willReturn($this->product); $this->action->execute(); }
/** * {@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); } }
/** * {@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); } }