$context->setOutput( $outputPage );
if ( $skin ) {
+ // Based on OutputPage::headElement()
+ $skin->setupSkinUserCss( $outputPage );
// Based on OutputPage::output()
foreach ( $skin->getDefaultModules() as $group ) {
$outputPage->addModules( $group );
$factory = new SkinFactory();
$factory->register( 'testing', 'Testing', function () {
$skin = $this->getMockBuilder( SkinFallback::class )
- ->setMethods( [ 'getDefaultModules' ] )
+ ->setMethods( [ 'getDefaultModules', 'setupSkinUserCss' ] )
->getMock();
$skin->expects( $this->once() )->method( 'getDefaultModules' )
->willReturn( [
'core' => [ 'foo', 'bar' ],
'content' => [ 'baz' ]
] );
+ $skin->expects( $this->once() )->method( 'setupSkinUserCss' )
+ ->will( $this->returnCallback( function ( OutputPage $out ) {
+ $out->addModuleStyles( 'foo.styles' );
+ } ) );
return $skin;
} );
$this->setService( 'SkinFactory', $factory );
'resp.parse.modulescripts'
);
$this->assertSame(
- [],
+ [ 'foo.styles' ],
$res[0]['parse']['modulestyles'],
'resp.parse.modulestyles'
);