コード例 #1
0
ファイル: SaveTest.php プロジェクト: Doability/magento2dev
 /**
  * @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();
 }
コード例 #2
0
ファイル: Interceptor.php プロジェクト: rustamveer/magento2
 /**
  * {@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);
     }
 }