diff options
Diffstat (limited to 'tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php')
-rw-r--r-- | tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php index 6ac037795cb4..59649153e912 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php @@ -93,6 +93,33 @@ class ResourceLoaderWikiModuleTest extends ResourceLoaderTestCase { } /** + * @dataProvider provideGetType + */ + public function testGetType( $params, $expected ) { + $module = new ResourceLoaderWikiModule( $params ); + $this->assertSame( $expected, $module->getType() ); + } + + public static function provideGetType() { + yield 'empty' => [ + [], + ResourceLoaderWikiModule::LOAD_GENERAL, + ]; + yield 'scripts' => [ + [ 'scripts' => [ 'Example.js' ] ], + ResourceLoaderWikiModule::LOAD_GENERAL, + ]; + yield 'styles' => [ + [ 'styles' => [ 'Example.css' ] ], + ResourceLoaderWikiModule::LOAD_STYLES, + ]; + yield 'styles and scripts' => [ + [ 'styles' => [ 'Example.css' ], 'scripts' => [ 'Example.js' ] ], + ResourceLoaderWikiModule::LOAD_GENERAL, + ]; + } + + /** * @dataProvider provideIsKnownEmpty */ public function testIsKnownEmpty( $titleInfo, $group, $dependencies, $expected ) { |