Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
[mediawiki.git] / tests / phpunit / LessFileCompilationTest.php
blobf67fe02f3f72d742f2b9a7aa011255e7c8fae189
1 <?php
3 /**
4 * Modelled on Sebastian Bergmann's PHPUnit_Extensions_PhptTestCase class.
6 * @see https://github.com/sebastianbergmann/phpunit/blob/master/src/Extensions/PhptTestCase.php
7 * @author Sam Smith <samsmith@wikimedia.org>
8 */
9 class LessFileCompilationTest extends MediaWikiTestCase {
11 /**
12 * @var string $file
14 protected $file;
16 /**
17 * @var ResourceLoaderModule The ResourceLoader module that contains
18 * the file
20 protected $module;
22 /**
23 * @param string $file
24 * @param ResourceLoaderModule $module The ResourceLoader module that
25 * contains the file
26 * @throws PHPUnit_Framework_Exception When the file parameter isn't a
27 * string or readable file
29 public function __construct( $file, ResourceLoaderModule $module ) {
30 if ( !is_string( $file ) || !is_file( $file ) || !is_readable( $file ) ) {
31 throw PHPUnit_Util_InvalidArgumentHelper::factory( 1, 'readable file' );
34 parent::__construct( 'testLessFileCompilation' );
36 $this->file = $file;
37 $this->module = $module;
40 public function testLessFileCompilation() {
41 $compiler = ResourceLoader::getLessCompiler();
42 $this->assertNotNull( $compiler->compileFile( $this->file ) );
45 public function getName( $withDataSet = true ) {
46 return $this->toString();
49 public function toString() {
50 $moduleName = $this->module->getName();
52 return "{$this->file} in the \"{$moduleName}\" module";