Merge "Fix setting hooks in ApiQueryTest"
[lhc/web/wiklou.git] / tests / phpunit / includes / resourceloader / ResourceLoaderFileModuleTest.php
1 <?php
2
3 class ResourceLoaderFileModuleTest extends ResourceLoaderTestCase {
4
5 protected function setUp() {
6 parent::setUp();
7
8 // The return value of the closure shouldn't matter since this test should
9 // never call it
10 SkinFactory::getDefaultInstance()->register(
11 'fakeskin',
12 'FakeSkin',
13 function () {
14 }
15 );
16 }
17
18 /**
19 * @covers ResourceLoaderFileModule::getAllSkinStyleFiles
20 */
21 public function testGetAllSkinStyleFiles() {
22 $baseParams = array(
23 'scripts' => array(
24 'foo.js',
25 'bar.js',
26 ),
27 'styles' => array(
28 'foo.css',
29 'bar.css' => array( 'media' => 'print' ),
30 'screen.less' => array( 'media' => 'screen' ),
31 'screen-query.css' => array( 'media' => 'screen and (min-width: 400px)' ),
32 ),
33 'skinStyles' => array(
34 'default' => 'quux-fallback.less',
35 'fakeskin' => array(
36 'baz-vector.css',
37 'quux-vector.less',
38 ),
39 ),
40 'messages' => array(
41 'hello',
42 'world',
43 ),
44 );
45
46 $module = new ResourceLoaderFileModule( $baseParams );
47
48 $this->assertEquals(
49 array(
50 'foo.css',
51 'baz-vector.css',
52 'quux-vector.less',
53 'quux-fallback.less',
54 'bar.css',
55 'screen.less',
56 'screen-query.css',
57 ),
58 array_map( 'basename', $module->getAllStyleFiles() )
59 );
60 }
61 }