Esempio n. 1
0
 /**
  * @covers \Magento\Framework\Less\PreProcessor\Instruction\Import::resetRelatedFiles
  */
 public function testGetRelatedFiles()
 {
     $this->assertSame([], $this->object->getRelatedFiles());
     $this->notationResolver->expects($this->once())->method('convertModuleNotationToPath')->with($this->asset, 'Magento_Module::something.css')->will($this->returnValue('Magento_Module/something.css'));
     $chain = new \Magento\Framework\View\Asset\PreProcessor\Chain($this->asset, '@import (type) "Magento_Module::something.css" media;', 'css');
     $this->object->process($chain);
     $chain = new \Magento\Framework\View\Asset\PreProcessor\Chain($this->asset, 'color: #000000;', 'css');
     $this->object->process($chain);
     $expected = [['Magento_Module::something.css', $this->asset]];
     $this->assertSame($expected, $this->object->getRelatedFiles());
     $this->object->resetRelatedFiles();
     $this->assertSame([], $this->object->getRelatedFiles());
 }
 /**
  * Create all asset files, referenced from already processed ones
  *
  * @param Import $importGenerator
  *
  * @return void
  */
 public function generate(Import $importGenerator)
 {
     do {
         $relatedFiles = $importGenerator->getRelatedFiles();
         $importGenerator->resetRelatedFiles();
         foreach ($relatedFiles as $relatedFileInfo) {
             list($relatedFileId, $asset) = $relatedFileInfo;
             $this->generateRelatedFile($relatedFileId, $asset);
         }
     } while ($relatedFiles);
 }
Esempio n. 3
0
 /**
  * Create all asset files, referenced from already processed ones
  *
  * @return void
  */
 protected function generateRelatedFiles()
 {
     do {
         $relatedFiles = $this->importProcessor->getRelatedFiles();
         $this->importProcessor->resetRelatedFiles();
         foreach ($relatedFiles as $relatedFileInfo) {
             list($relatedFileId, $asset) = $relatedFileInfo;
             $this->generateRelatedFile($relatedFileId, $asset);
         }
     } while ($relatedFiles);
 }