This optimisation attempts to minimise loading the styles in places they are not needed. The logic is kept inside Skin::getDefaultModules to avoid fragmentation of where modules get defined. Update ApiParse to avoid repetition of code. Bug: T42792 Bug: T42812 Change-Id: I59f02a7bab3baa9d43f6bc2ef1f549d9d31d8456
16 lines
468 B
PHP
16 lines
468 B
PHP
<?php
|
|
class SkinTest extends MediaWikiTestCase {
|
|
|
|
/**
|
|
* @covers Skin::getDefaultModules
|
|
*/
|
|
public function testGetDefaultModules() {
|
|
$skin = $this->getMockBuilder( Skin::class )
|
|
->setMethods( [ 'outputPage', 'setupSkinUserCss' ] )
|
|
->getMock();
|
|
|
|
$modules = $skin->getDefaultModules();
|
|
$this->assertTrue( isset( $modules['core'] ), 'core key is set by default' );
|
|
$this->assertTrue( isset( $modules['styles'] ), 'style key is set by default' );
|
|
}
|
|
}
|