Ejemplo n.º 1
0
 public function testGetInstancesNamesList()
 {
     $this->model->addDefinition(self::INSTANCE_1, $this->getArgument());
     $this->assertEquals([self::INSTANCE_1], $this->model->getInstancesNamesList());
 }
Ejemplo n.º 2
0
 /**
  * Returns preferences for third party code
  *
  * @param ConfigInterface $config
  * @param DefinitionsCollection $definitionsCollection
  *
  * @return void
  */
 private function fillThirdPartyInterfaces(ConfigInterface $config, DefinitionsCollection $definitionsCollection)
 {
     $definedInstances = $definitionsCollection->getInstancesNamesList();
     foreach (array_keys($config->getPreferences()) as $interface) {
         if (in_array($interface, $definedInstances)) {
             continue;
         }
         $definitionsCollection->addDefinition($interface, []);
     }
 }