Beispiel #1
0
 /**
  * @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 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);
     }
 }
Beispiel #3
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);
     }
 }