$options += [
'lang' => 'en',
'dir' => 'ltr',
+ 'skin' => 'vector',
'modules' => 'startup',
'only' => 'scripts',
];
'lang' => $options['lang'],
'modules' => $options['modules'],
'only' => $options['only'],
- 'skin' => 'vector',
+ 'skin' => $options['skin'],
'target' => 'phpunit',
] );
$ctx = $this->getMockBuilder( 'ResourceLoaderContext' )
protected $isKnownEmpty = false;
protected $type = ResourceLoaderModule::LOAD_GENERAL;
protected $targets = [ 'phpunit' ];
+ protected $shouldEmbed = null;
public function __construct( $options = [] ) {
foreach ( $options as $key => $value ) {
return $this->isKnownEmpty;
}
+ public function shouldEmbedModule( ResourceLoaderContext $context ) {
+ return $this->shouldEmbed !== null ? $this->shouldEmbed : parent::shouldEmbedModule( $context );
+ }
+
public function enableModuleContentVersion() {
return true;
}
}
+class ResourceLoaderFileTestModule extends ResourceLoaderFileModule {
+ protected $lessVars = [];
+
+ public function __construct( $options = [], $test = [] ) {
+ parent::__construct( $options );
+
+ foreach ( $test as $key => $value ) {
+ $this->$key = $value;
+ }
+ }
+
+ public function getLessVars( ResourceLoaderContext $context ) {
+ return $this->lessVars;
+ }
+}
+
class ResourceLoaderFileModuleTestModule extends ResourceLoaderFileModule {
}