The check for file existence before checking its MIME type was
building the path incorrectly, causing this piece of code to always
think the file does not exist. (The code to actually embed the file
was correct.)
This was not caught by the tests before of a bug in the test code,
which cancelled out this one.
Bug: T100958
Change-Id: I4469079f41d48052d0a02f98bb1ed02407abd54c
);
$url = $match['file'] . $match['query'];
- $file = $local . $match['file'];
+ $file = "{$local}/{$match['file']}";
if (
!self::isRemoteUrl( $url ) && !self::isLocalUrl( $url )
&& file_exists( $file )
* @covers CSSMin::remap
*/
public function testRemapRemapping( $message, $input, $expectedOutput ) {
- $localPath = __DIR__ . '/../../data/cssmin/';
- $remotePath = 'http://localhost/w/';
+ $localPath = __DIR__ . '/../../data/cssmin';
+ $remotePath = 'http://localhost/w';
$realOutput = CSSMin::remap( $input, $localPath, $remotePath );
$this->assertEquals( $expectedOutput, $realOutput, "CSSMin::remap: $message" );