Ejemplo n.º 1
0
 /**
  * @covers ::getLibrariesByExtension
  */
 public function testGetLibrariesByExtension()
 {
     $this->libraryDiscoveryCollector->expects($this->once())->method('get')->with('test')->willReturn($this->libraryData);
     $this->libraryDiscovery->getLibrariesbyExtension('test');
     // Verify that subsequent calls don't trigger hook_library_info_alter()
     // and hook_js_settings_alter() invocations, nor do they talk to the
     // collector again. This ensures that the alterations made by
     // hook_library_info_alter() and hook_js_settings_alter() implementations
     // are statically cached, as desired.
     $this->libraryDiscovery->getLibraryByName('test', 'test_1');
     $this->libraryDiscovery->getLibrariesbyExtension('test');
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function getLibrariesByExtension($extension)
 {
     if (!isset($this->libraryDefinitions[$extension])) {
         $libraries = $this->collector->get($extension);
         $this->libraryDefinitions[$extension] = [];
         foreach ($libraries as $name => $definition) {
             $library_name = "{$extension}/{$name}";
             $this->libraryDefinitions[$extension][$name] = $definition;
         }
     }
     return $this->libraryDefinitions[$extension];
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function clearCachedDefinitions()
 {
     $this->libraryDefinitions = [];
     $this->collector->clear();
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function clearCachedDefinitions()
 {
     $this->cacheTagInvalidator->invalidateTags(['library_info']);
     $this->libraryDefinitions = [];
     $this->collector->clear();
 }
Ejemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function clearCachedDefinitions()
 {
     $this->collector->clear();
 }
 /**
  * {@inheritdoc}
  */
 public function getLibrariesByExtension($extension)
 {
     return $this->collector->get($extension);
 }