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>
10 class LessFileCompilationTest
extends ResourceLoaderTestCase
{
18 * @var ResourceLoaderModule The ResourceLoader module that contains
25 * @param ResourceLoaderModule $module The ResourceLoader module that
28 public function __construct( $file, ResourceLoaderModule
$module ) {
29 parent
::__construct( 'testLessFileCompilation' );
32 $this->module
= $module;
35 public function testLessFileCompilation() {
36 $thisString = $this->toString();
38 is_string( $this->file
) && is_file( $this->file
) && is_readable( $this->file
),
39 "$thisString must refer to a readable file"
42 $rlContext = $this->getResourceLoaderContext();
45 $method = new ReflectionMethod( $this->module
, 'compileLessFile' );
46 $method->setAccessible( true );
47 $this->assertNotNull( $method->invoke( $this->module
, $this->file
, $rlContext ) );
50 public function toString() {
51 $moduleName = $this->module
->getName();
53 return "{$this->file} in the \"{$moduleName}\" module";