Beispiel #1
0
 public function testEmptyFiles()
 {
     $this->assertTrue($this->object->getJoinFiles());
     $this->object->setFileCollection(new \WebLoader\FileCollection());
     $ret = $this->object->generate();
     $this->assertEquals(0, count($ret));
     $this->assertEquals(0, count($this->getTempFiles()));
 }
Beispiel #2
0
 /**
  * Generate compiled file(s) and render link(s)
  */
 public function render()
 {
     $hasArgs = func_num_args() > 0;
     if ($hasArgs) {
         $backup = $this->compiler->getFileCollection();
         $newFiles = new FileCollection($backup->getRoot());
         $newFiles->addFiles(func_get_args());
         $this->compiler->setFileCollection($newFiles);
     }
     // remote files
     foreach ($this->compiler->getFileCollection()->getRemoteFiles() as $file) {
         echo $this->getElement($file), PHP_EOL;
     }
     foreach ($this->compiler->generate() as $file) {
         echo $this->getElement($this->tempPath . '/' . $file->file . '?' . $file->lastModified), PHP_EOL;
     }
     if ($hasArgs) {
         $this->compiler->setFileCollection($backup);
     }
 }