Example #1
0
 /**
  *  Test for `save` method for duplicated product
  */
 public function testSaveAndDuplicate()
 {
     $this->model->setIsDuplicate(true);
     $this->configureSaveTest();
     $this->model->beforeSave();
     $this->model->afterSave();
 }
 /**
  *  Test for `save` method for duplicated product
  */
 public function testSaveAndDuplicate()
 {
     $this->imageCache->expects($this->once())->method('generate')->with($this->model);
     $this->imageCacheFactory->expects($this->once())->method('create')->willReturn($this->imageCache);
     $this->model->setIsDuplicate(true);
     $this->configureSaveTest();
     $this->model->beforeSave();
     $this->model->afterSave();
 }
 /**
  * {@inheritdoc}
  */
 public function beforeSave()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'beforeSave');
     if (!$pluginInfo) {
         return parent::beforeSave();
     } else {
         return $this->___callPlugins('beforeSave', func_get_args(), $pluginInfo);
     }
 }