public function testLoadCatalogPromotions() { $originalCatalogPromotion = $this->dummyData->getCatalogPromotion(); $catalogPromotionRepository = $this->mockRepository->getCatalogPromotionRepository(); $catalogPromotionRepository->shouldreceive('findAll')->andReturn([$originalCatalogPromotion])->once(); $this->pricing->loadCatalogPromotions($catalogPromotionRepository); $catalogPromotions = $this->pricing->getCatalogPromotions(); $this->assertEntitiesEqual($originalCatalogPromotion, $catalogPromotions[0]); }
public function getPricing() { static $pricing = null; if ($pricing === null) { $pricing = new Pricing(); $pricing->loadCatalogPromotions($this->getRepositoryFactory()->getCatalogPromotionRepository()); } return $pricing; }