MediaWiki  REL1_23
LessFileCompilationTest.php
Go to the documentation of this file.
00001 <?php
00002 
00009 class LessFileCompilationTest extends MediaWikiTestCase {
00010 
00014     protected $file;
00015 
00020     protected $module;
00021 
00029     public function __construct( $file, ResourceLoaderModule $module ) {
00030         if ( !is_string( $file ) || !is_file( $file ) || !is_readable( $file ) ) {
00031             throw PHPUnit_Util_InvalidArgumentHelper::factory( 1, 'readable file' );
00032         }
00033 
00034         parent::__construct( 'testLessFileCompilation' );
00035 
00036         $this->file = $file;
00037         $this->module = $module;
00038     }
00039 
00040     public function testLessFileCompilation() {
00041         $compiler = ResourceLoader::getLessCompiler();
00042         $this->assertNotNull( $compiler->compileFile( $this->file ) );
00043     }
00044 
00045     public function getName( $withDataSet = true ) {
00046         return $this->toString();
00047     }
00048 
00049     public function toString() {
00050         $moduleName = $this->module->getName();
00051 
00052         return "{$this->file} in the \"{$moduleName}\" module";
00053     }
00054 }