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>
9 class LessFileCompilationTest
extends ResourceLoaderTestCase
{
17 * @var ResourceLoaderModule The ResourceLoader module that contains
24 * @param ResourceLoaderModule $module The ResourceLoader module that
27 public function __construct( $file, ResourceLoaderModule
$module ) {
28 parent
::__construct( 'testLessFileCompilation' );
31 $this->module
= $module;
34 public function testLessFileCompilation() {
35 $thisString = $this->toString();
37 is_string( $this->file
) && is_file( $this->file
) && is_readable( $this->file
),
38 "$thisString must refer to a readable file"
41 $rlContext = $this->getResourceLoaderContext();
44 $method = new ReflectionMethod( $this->module
, 'compileLessFile' );
45 $method->setAccessible( true );
46 $this->assertNotNull( $method->invoke( $this->module
, $this->file
, $rlContext ) );
49 public function toString() {
50 $moduleName = $this->module
->getName();
52 return "{$this->file} in the \"{$moduleName}\" module";