From 14f74d141ab5580688bfd46d2f74c026e43ed967 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 1 Apr 2015 06:11:44 +0200 Subject: Update to MediaWiki 1.24.2 --- tests/phpunit/LessFileCompilationTest.php | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 tests/phpunit/LessFileCompilationTest.php (limited to 'tests/phpunit/LessFileCompilationTest.php') diff --git a/tests/phpunit/LessFileCompilationTest.php b/tests/phpunit/LessFileCompilationTest.php new file mode 100644 index 00000000..71e0f4b2 --- /dev/null +++ b/tests/phpunit/LessFileCompilationTest.php @@ -0,0 +1,60 @@ + + */ +class LessFileCompilationTest extends ResourceLoaderTestCase { + + /** + * @var string $file + */ + protected $file; + + /** + * @var ResourceLoaderModule The ResourceLoader module that contains + * the file + */ + protected $module; + + /** + * @param string $file + * @param ResourceLoaderModule $module The ResourceLoader module that + * contains the file + */ + public function __construct( $file, ResourceLoaderModule $module ) { + parent::__construct( 'testLessFileCompilation' ); + + $this->file = $file; + $this->module = $module; + } + + public function testLessFileCompilation() { + $thisString = $this->toString(); + $this->assertTrue( + is_string( $this->file ) && is_file( $this->file ) && is_readable( $this->file ), + "$thisString must refer to a readable file" + ); + + $rlContext = static::getResourceLoaderContext(); + + // Bleh + $method = new ReflectionMethod( $this->module, 'getLessCompiler' ); + $method->setAccessible( true ); + $compiler = $method->invoke( $this->module, $rlContext ); + + $this->assertNotNull( $compiler->compileFile( $this->file ) ); + } + + public function getName( $withDataSet = true ) { + return $this->toString(); + } + + public function toString() { + $moduleName = $this->module->getName(); + + return "{$this->file} in the \"{$moduleName}\" module"; + } +} -- cgit v1.2.3-54-g00ecf