rdbms: Rename "memCache" to "memStash" in LBFactory
[mediawiki.git] / tests / phpunit / includes / resourceloader / ResourceLoaderOOUIImageModuleTest.php
blob491fff6b1c083eb28dca551fd1c10b2982748037
1 <?php
3 /**
4 * @group ResourceLoader
5 */
6 class ResourceLoaderOOUIImageModuleTest extends ResourceLoaderTestCase {
8 /**
9 * @covers ResourceLoaderOOUIImageModule::loadFromDefinition
11 public function testNonDefaultSkin() {
12 $module = new ResourceLoaderOOUIImageModule( [
13 'class' => 'ResourceLoaderOOUIImageModule',
14 'name' => 'icons',
15 'rootPath' => 'tests/phpunit/data/resourceloader/oouiimagemodule',
16 ] );
18 // Pretend that 'fakemonobook' is a real skin using the Apex theme
19 SkinFactory::getDefaultInstance()->register(
20 'fakemonobook',
21 'FakeMonoBook',
22 function () {
25 $r = new ReflectionMethod( 'ExtensionRegistry', 'exportExtractedData' );
26 $r->setAccessible( true );
27 $r->invoke( ExtensionRegistry::getInstance(), [
28 'globals' => [],
29 'defines' => [],
30 'callbacks' => [],
31 'credits' => [],
32 'autoloaderPaths' => [],
33 'attributes' => [
34 'SkinOOUIThemes' => [
35 'fakemonobook' => 'Apex',
38 ] );
40 $styles = $module->getStyles( $this->getResourceLoaderContext( [ 'skin' => 'fakemonobook' ] ) );
41 $this->assertRegExp(
42 '/stu-apex/',
43 $styles['all'],
44 'Generated styles use the non-default image (embed)'
46 $this->assertRegExp(
47 '/fakemonobook/',
48 $styles['all'],
49 'Generated styles use the non-default image (link)'
52 $styles = $module->getStyles( $this->getResourceLoaderContext() );
53 $this->assertRegExp(
54 '/stu-wikimediaui/',
55 $styles['all'],
56 'Generated styles use the default image (embed)'
58 $this->assertRegExp(
59 '/vector/',
60 $styles['all'],
61 'Generated styles use the default image (link)'