function it_aggregates_the_unique_resources_locales(TranslatorResourceProviderInterface $firstResourceProvider, TranslatorResourceProviderInterface $secondResourceProvider)
 {
     $this->beConstructedWith([$firstResourceProvider, $secondResourceProvider]);
     $firstResourceProvider->getResourcesLocales()->willReturn(['first-locale']);
     $secondResourceProvider->getResourcesLocales()->willReturn(['second-locale', 'first-locale', 'second-locale']);
     $this->getResourcesLocales()->shouldReturn(['first-locale', 'second-locale']);
 }
Exemple #2
0
 private function addResources()
 {
     if ($this->resourcesLoaded) {
         return;
     }
     $resources = $this->resourceProvider->getResources();
     foreach ($resources as $resource) {
         $this->addResource($resource->getFormat(), $resource->getName(), $resource->getLocale(), $resource->getDomain());
     }
     $this->resourcesLoaded = true;
 }