private function stubCompiler($extension)
 {
     $compiler = new ProcessorStub();
     $compiler->setFileExtension($extension);
     $this->target->add($compiler);
     return $compiler;
 }
 /**
  * @test
  */
 public function getLastModified_success()
 {
     $time = new DateTime();
     $files = ['example.file' => $time];
     $this->stubProcessor('example.file', 'content', $time, $files);
     $this->processor->setLastModified('example.file', $time);
     $this->assertSame($time, $this->target->getLastModified('example.file'));
     $this->assertCacheEntry('example.file', 'content', $time, $files);
 }
Esempio n. 3
0
 private function stubFileWithProcessor($file, $return, $mimeType)
 {
     $this->files->add($file);
     $processor = new ProcessorStub();
     $processor->set($file, $return);
     $processor->setOutputMimeType($mimeType);
     $processor->setLastModified($file, new DateTime());
     $processor->setFiles($file, [$file => new DateTime()]);
     $this->processor->set($file, $processor);
 }
 /**
  * @test
  */
 public function addCompiler_success()
 {
     $compiler = new ProcessorStub();
     $compiler->setFileExtension('css');
     $this->assertSame($this->target, $this->target->addCompiler($compiler));
     $list = $this->compiler->getAdded();
     $this->assertNotEmpty($list);
     $this->assertSame($compiler, reset($list));
 }