From: Timo Tijhof Date: Sun, 24 Jun 2018 01:59:44 +0000 (+0100) Subject: resourceloader: Add coverage for StartupModule::getDefinitionSummary X-Git-Tag: 1.34.0-rc.0~4981^2 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=afffa55567633fcd604adcc3d654f03d76986671;p=lhc%2Fweb%2Fwiklou.git resourceloader: Add coverage for StartupModule::getDefinitionSummary Change-Id: I913c8ecd5f51db851ef408c4281cdd75a0e0b239 --- diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php index 698370463a..810d1fee62 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php @@ -561,4 +561,32 @@ mw.loader.register( [ ); } + /** + * @covers ResourceLoaderStartupModule::getDefinitionSummary + */ + public function testGetVersionHash_varyConfig() { + $context = $this->getResourceLoaderContext(); + + $this->setMwGlobals( 'wgArticlePath', '/w1' ); + $module = new ResourceLoaderStartupModule(); + $version1 = $module->getVersionHash( $context ); + $module = new ResourceLoaderStartupModule(); + $version2 = $module->getVersionHash( $context ); + $this->setMwGlobals( 'wgArticlePath', '/w3' ); + $module = new ResourceLoaderStartupModule(); + $version3 = $module->getVersionHash( $context ); + + $this->assertEquals( + $version1, + $version2, + 'Deterministic version hash' + ); + + $this->assertNotEquals( + $version1, + $version3, + 'Config change impacts version hash' + ); + } + }