/** * @covers ResourceLoaderFileModule::compileLessFile */ public function testLessFileCompilation() { $context = $this->getResourceLoaderContext(); $basePath = __DIR__ . '/../../data/less/module'; $module = new ResourceLoaderFileModule(array('localBasePath' => $basePath, 'styles' => array('styles.less'))); $module->setName('test.less'); $styles = $module->getStyles($context); $this->assertStringEqualsFile($basePath . '/styles.css', $styles['all']); }
public function testBomConcatenation() { $basePath = __DIR__ . '/../../data/css'; $testModule = new ResourceLoaderFileModule(['localBasePath' => $basePath, 'styles' => ['bom.css']]); $testModule->setName('testing'); $this->assertEquals(substr(file_get_contents("{$basePath}/bom.css"), 0, 10), ".efbbbf", 'File has leading BOM'); $contextLtr = $this->getResourceLoaderContext('en', 'ltr'); $this->assertEquals($testModule->getStyles($contextLtr), ['all' => ".efbbbf_bom_char_at_start_of_file {}\n"], 'Leading BOM removed when concatenating files'); }