Esempio n. 1
0
 /**
  * @param $type
  * @param $methodName
  * @dataProvider updateWebsitesDataProvider
  */
 public function testUpdateWebsites($type, $methodName)
 {
     $productIds = [1, 2, 2, 4];
     $productIdsUnique = [0 => 1, 1 => 2, 3 => 4];
     $websiteIds = [1];
     $this->productWebsite->expects($this->any())->method($methodName)->with($websiteIds, $productIds)->will($this->returnSelf());
     $this->categoryIndexer->expects($this->any())->method('isScheduled')->will($this->returnValue(false));
     $this->categoryIndexer->expects($this->any())->method('reindexList')->will($this->returnValue($productIds));
     $this->prepareIndexer();
     $this->model->updateWebsites($productIds, $websiteIds, $type);
     $this->assertEquals($this->model->getDataByKey('product_ids'), $productIdsUnique);
     $this->assertEquals($this->model->getDataByKey('website_ids'), $websiteIds);
     $this->assertEquals($this->model->getDataByKey('action_type'), $type);
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function getDataByKey($key)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getDataByKey');
     if (!$pluginInfo) {
         return parent::getDataByKey($key);
     } else {
         return $this->___callPlugins('getDataByKey', func_get_args(), $pluginInfo);
     }
 }