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(); }
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(); }
/** * {@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); } }
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(); }