/** * @param string $exceptionType * @return void * @dataProvider exceptionTypeDataProvider */ public function testExecuteSetsProductDataToSessionAndRedirectsToNewActionOnError($exceptionType) { $productData = ['product' => ['name' => 'test-name']]; $this->request->expects($this->any())->method('getPostValue')->willReturn($productData); $this->initializationHelper->expects($this->any())->method('initialize')->willReturn($this->product); $this->product->expects($this->any())->method('getSku')->willThrowException(new $exceptionType(__('message'))); $this->resultRedirect->expects($this->once())->method('setPath')->with('catalog/*/new'); $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); } }