Пример #1
0
 /**
  * Test isRuleBehaviorChanged action
  *
  * @dataProvider isRuleBehaviorChangedDataProvider
  *
  * @param array $dataArray
  * @param array $originDataArray
  * @param bool $isObjectNew
  * @param bool $result
  *
  * @return void
  */
 public function testIsRuleBehaviorChanged($dataArray, $originDataArray, $isObjectNew, $result)
 {
     $this->rule->setData('website_ids', []);
     $this->rule->isObjectNew($isObjectNew);
     $indexer = $this->getMock('\\Magento\\Framework\\Indexer\\IndexerInterface');
     $indexer->expects($this->any())->method('invalidate');
     $this->_ruleProductProcessor->expects($this->any())->method('getIndexer')->will($this->returnValue($indexer));
     foreach ($dataArray as $data) {
         $this->rule->setData($data);
     }
     $this->rule->afterSave();
     foreach ($originDataArray as $data) {
         $this->rule->setOrigData($data);
     }
     $this->assertEquals($result, $this->rule->isRuleBehaviorChanged());
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function isRuleBehaviorChanged()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'isRuleBehaviorChanged');
     if (!$pluginInfo) {
         return parent::isRuleBehaviorChanged();
     } else {
         return $this->___callPlugins('isRuleBehaviorChanged', func_get_args(), $pluginInfo);
     }
 }