예제 #1
0
 /**
  * @test
  */
 public function get_successWithCache()
 {
     $this->context->setCache(true);
     $compiler = $this->stubCompiler('css');
     $result = $this->target->get('asset/test.css');
     $this->assertInstanceOf(CachedProcessor::class, $result);
     $this->assertSame($compiler, $result->getProcessor());
 }
예제 #2
0
 /**
  * @test
  */
 public function getFilePath_success()
 {
     $this->context->setCachePath('/cache/');
     $result = $this->target->getFilePath('/path/file.txt');
     $this->assertNotEmpty($result);
     $this->assertStringStartsWith('/cache/', $result);
     $this->assertContains(md5('/path/file.txt'), $result);
 }
예제 #3
0
 /**
  * @test
  */
 public function createDebug_success()
 {
     $builder = $this->target->createDebug('/absolute/', 'assets/css');
     $this->assertNotNull($builder);
     $this->assertInstanceOf(Builder::class, $builder);
     $this->assertEquals('/absolute/', $this->context->getRootPath());
     $this->assertFalse($this->context->hasMinifier());
     $this->assertTrue($this->context->hasDebug());
     $this->assertTrue($this->context->hasStopWatch());
 }
예제 #4
0
 /**
  * @test
  */
 public function execute_successWithCaching()
 {
     $this->context->setCache(true);
     $this->cache->set(new FileList(), 'cached');
     $iterator = $this->createGroupList('success', 'group-name');
     $this->assertSame($this->target, $this->target->addGroups($iterator));
     $this->assertEquals('cached', $this->target->execute('group-name'));
 }
예제 #5
0
 /**
  * @test
  */
 public function getAbsolutePath_successForWindows()
 {
     $this->context->setRootPath('C:\\absolute\\');
     $this->assertEquals('C:\\root\\file.txt', $this->target->getAbsolutePath('C:\\root\\file.txt'));
 }