+
+ public function testBomConcatenation() {
+ $basePath = __DIR__ . '/../../data/css';
+ $testModule = new ResourceLoaderFileModule( [
+ 'localBasePath' => $basePath,
+ 'styles' => [ 'bom.css' ],
+ ] );
+ $this->assertEquals(
+ substr( file_get_contents( "$basePath/bom.css" ), 0, 10 ),
+ "\xef\xbb\xbf.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'
+ );
+ }