/** * @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()); }
/** * @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); }
/** * @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()); }
/** * @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')); }
/** * @test */ public function getAbsolutePath_successForWindows() { $this->context->setRootPath('C:\\absolute\\'); $this->assertEquals('C:\\root\\file.txt', $this->target->getAbsolutePath('C:\\root\\file.txt')); }