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 execute()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'execute');
     if (!$pluginInfo) {
         return parent::execute();
     } else {
         return $this->___callPlugins('execute', func_get_args(), $pluginInfo);
     }
 }