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();
 }
示例#2
0
 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();
 }
示例#3
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);
     }
 }
示例#4
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);
     }
 }