public function testExecuteObtainsProductDataFromSession()
 {
     $this->action->getRequest()->expects($this->any())->method('getParam')->willReturn(true);
     $this->action->getRequest()->expects($this->any())->method('getFullActionName')->willReturn('catalog_product_new');
     $this->session->expects($this->any())->method('getProductData')->willReturn(['product' => ['name' => 'test-name']]);
     $this->product->expects($this->once())->method('addData')->with(['name' => 'test-name', 'stock_data' => null]);
     $this->action->execute();
 }
示例#2
0
 public function testExecuteObtainsProductDataFromSession()
 {
     $this->action->getRequest()->expects($this->any())->method('getParam')->willReturn(true);
     $this->action->getRequest()->expects($this->any())->method('getFullActionName')->willReturn('catalog_product_new');
     $productData = ['name' => 'test-name', 'stock_data' => null];
     $this->session->expects($this->any())->method('getProductData')->willReturn(['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
 public function testExecute()
 {
     $this->action->getRequest()->expects($this->any())->method('getParam')->willReturn(true);
     $this->action->getRequest()->expects($this->any())->method('getFullActionName')->willReturn('catalog_product_new');
     $this->action->execute();
 }
 /**
  * {@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);
     }
 }