The icons in Flow and the Compact Personal Bar beta feature are missing, their generated background-image 7 is empty. The lessphp implementation passes full data frames into the helper functions. Utilize the now-public compileValue method of less to evaluate the data frame into a string. Additionally adds a small abstraction to run pairs of less/css files as unit tests by executing the less file and comparing it to the equivalent css file. Change-Id: I1704f84638d86a0e6e6b9c190972ab19180bd484
28 lines
716 B
PHP
28 lines
716 B
PHP
<?php
|
|
|
|
class ResourceLoaderLESSTest extends MediaWikiTestCase {
|
|
public static function lessProvider() {
|
|
$result = array();
|
|
foreach ( glob( __DIR__ . '/fixtures/*.less' ) as $file ) {
|
|
$result[] = array( $file );
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* @dataProvider lessProvider
|
|
*/
|
|
public function testLessFile( $lessFile ) {
|
|
$cssFile = substr( $lessFile, 0, -4 ) . 'css';
|
|
if ( !file_exists( $cssFile ) ) {
|
|
$this->fail( "No css file found to assert equal to $lessFile" );
|
|
return;
|
|
}
|
|
|
|
$expect = file_get_contents( $cssFile );
|
|
$content = file_get_contents( $lessFile );
|
|
$result = ResourceLoader::getLessCompiler()->compile( $content, $lessFile );
|
|
$this->assertEquals( $expect, $result );
|
|
}
|
|
}
|