Пример #1
0
 private function stubCompiler($extension)
 {
     $compiler = new ProcessorStub();
     $compiler->setFileExtension($extension);
     $this->target->add($compiler);
     return $compiler;
 }
Пример #2
0
 /**
  * @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);
 }
Пример #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);
 }
Пример #4
0
 /**
  * @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));
 }