diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2021-04-26 10:26:10 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2021-04-26 10:26:10 +0000 |
commit | 6727f4eafc612f364990604979f955ad81cc61e9 (patch) | |
tree | 6df1aecef29071f4e52c3909d2808345a14b2eb3 /tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php | |
parent | 14a02d74b32622d9631cb62274c35968f48935a4 (diff) | |
parent | ef951618d5837f008603feda408a65a72bd98730 (diff) | |
download | mediawikicore-6727f4eafc612f364990604979f955ad81cc61e9.tar.gz mediawikicore-6727f4eafc612f364990604979f955ad81cc61e9.zip |
Merge "Create the `content-links` (and -external) ResourceLoaderSkinModule feature"
Diffstat (limited to 'tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php')
-rw-r--r-- | tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php index 48c4a49e6932..ed7613c8cb98 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php @@ -6,6 +6,75 @@ use Wikimedia\TestingAccessWrapper; * @group ResourceLoader */ class ResourceLoaderSkinModuleTest extends MediaWikiIntegrationTestCase { + public function provideGetBackwardsCompatibleFeatures() { + return [ + [ + [], + [ + 'logo' => true, + 'legacy' => true + ], + 'For historic reasons if nothing is declared logo and legacy features are enabled.' + ], + [ + [ + 'features' => [ + 'content' => true, + ] + ], + [ + 'content-thumbnails' => true, + ], + 'The `content` feature is mapped to `content-thumbnails`.' + ], + [ + [ + 'features' => [ + 'content-links' => true, + ] + ], + [ + 'content-links-external' => true, + 'content-links' => true, + ], + 'The `content-links` feature will also enable `content-links-external` if it not specified.' + ], + [ + [ + 'features' => [ + 'element' => true, + ] + ], + [ + 'element' => true, + 'content-links' => true, + ], + 'The `element` feature will turn on `content-links` if not specified.' + ], + [ + [ + 'features' => [ + 'content-links-external' => false, + 'content-links' => true, + ] + ], + [ + 'content-links-external' => false, + 'content-links' => true, + ], + 'The `content-links` feature has no impact on content-links-external value.' + ], + ]; + } + + /** + * @dataProvider provideGetBackwardsCompatibleFeatures + * @covers ResourceLoaderSkinModule::getBackwardsCompatibleFeatures + */ + public function testGetBackwardsCompatibleFeatures( $options, $expected, $msg ) { + $actual = ResourceLoaderSkinModule::getBackwardsCompatibleFeatures( $options ); + $this->assertEquals( $expected, $actual, $msg ); + } public static function provideGetAvailableLogos() { return [ |