MediaWiki
REL1_31
LessFileCompilationTest.php
Go to the documentation of this file.
1
<?php
2
9
class
LessFileCompilationTest
extends
ResourceLoaderTestCase
{
10
14
protected
$file
;
15
20
protected
$module
;
21
27
public
function
__construct
( $file,
ResourceLoaderModule
$module
) {
28
parent::__construct(
'testLessFileCompilation'
);
29
30
$this->file =
$file
;
31
$this->module =
$module
;
32
}
33
34
public
function
testLessFileCompilation
() {
35
$thisString = $this->
toString
();
36
$this->assertTrue(
37
is_string( $this->file ) && is_file( $this->file ) && is_readable( $this->file ),
38
"$thisString must refer to a readable file"
39
);
40
41
$rlContext = $this->
getResourceLoaderContext
();
42
43
// Bleh
44
$method =
new
ReflectionMethod( $this->module,
'compileLessFile'
);
45
$method->setAccessible(
true
);
46
$this->assertNotNull( $method->invoke( $this->module, $this->file, $rlContext ) );
47
}
48
49
public
function
toString
() {
50
$moduleName = $this->module->getName();
51
52
return
"{$this->file} in the \"{$moduleName}\" module"
;
53
}
54
}
LessFileCompilationTest
Modelled on Sebastian Bergmann's PHPUnit_Extensions_PhptTestCase class.
Definition
LessFileCompilationTest.php:9
LessFileCompilationTest\$file
$file
Definition
LessFileCompilationTest.php:14
LessFileCompilationTest\$module
ResourceLoaderModule $module
The ResourceLoader module that contains the file.
Definition
LessFileCompilationTest.php:20
LessFileCompilationTest\toString
toString()
Definition
LessFileCompilationTest.php:49
LessFileCompilationTest\testLessFileCompilation
testLessFileCompilation()
Definition
LessFileCompilationTest.php:34
LessFileCompilationTest\__construct
__construct( $file, ResourceLoaderModule $module)
Definition
LessFileCompilationTest.php:27
ResourceLoaderModule
Abstraction for ResourceLoader modules, with name registration and maxage functionality.
Definition
ResourceLoaderModule.php:35
ResourceLoaderTestCase
Definition
ResourceLoaderTestCase.php:7
ResourceLoaderTestCase\getResourceLoaderContext
getResourceLoaderContext( $options=[], ResourceLoader $rl=null)
Definition
ResourceLoaderTestCase.php:23
tests
phpunit
LessFileCompilationTest.php
Generated on Mon Nov 25 2024 15:36:42 for MediaWiki by
1.10.0