/**
  * @param array  $mapOverridableProfessional
  * @param array  $mapOverridableEnterprise
  * @param string $edition
  * @param array  $result
  *
  * @dataProvider providerGetsNotOverridableClassMap
  */
 public function testGetsOverridableClassMap($mapOverridableCommunity, $mapOverridableProfessional, $mapOverridableEnterprise, $edition, $result)
 {
     $editionSelector = $this->getEditionSelectorStub($edition);
     $classMapCommunity = $this->getClassMapStub($mapOverridableCommunity, []);
     $classMapProfessional = $this->getClassMapStub($mapOverridableProfessional, []);
     $classMapEnterprise = $this->getClassMapStub($mapOverridableEnterprise, []);
     $classMapSelector = new ClassMapProvider($editionSelector);
     $classMapSelector->setClassMapCommunity($classMapCommunity);
     $classMapSelector->setClassMapProfessional($classMapProfessional);
     $classMapSelector->setClassMapEnterprise($classMapEnterprise);
     $this->assertSame($result, $classMapSelector->getOverridableClassMap());
 }
Exemplo n.º 2
0
 /**
  * @param ClassNameProvider     $classNameProvider
  * @param ModuleChainsGenerator $moduleChainsGenerator
  * @param ShopIdCalculator      $shopIdCalculator
  */
 public function __construct($classNameProvider = null, $moduleChainsGenerator = null, $shopIdCalculator = null)
 {
     if (!$classNameProvider) {
         $classMapProvider = new ClassMapProvider(new EditionSelector());
         $classNameProvider = new ClassNameProvider($classMapProvider->getOverridableClassMap());
     }
     $this->classNameProvider = $classNameProvider;
     if (!$shopIdCalculator) {
         $moduleVariablesCache = new FileCache();
         $editionSelector = new EditionSelector();
         if ($editionSelector->getEdition() === $editionSelector::ENTERPRISE) {
             $shopIdCalculator = new \OxidEsales\EshopEnterprise\Core\ShopIdCalculator($moduleVariablesCache);
         } else {
             $shopIdCalculator = new ShopIdCalculator($moduleVariablesCache);
         }
     }
     $this->shopIdCalculator = $shopIdCalculator;
     if (!$moduleChainsGenerator) {
         $subShopSpecificCache = new SubShopSpecificFileCache($shopIdCalculator);
         $moduleVariablesLocator = new ModuleVariablesLocator($subShopSpecificCache, $shopIdCalculator);
         $moduleChainsGenerator = new ModuleChainsGenerator($moduleVariablesLocator);
     }
     $this->moduleChainsGenerator = $moduleChainsGenerator;
 }