diff options
author | Timo Tijhof <krinklemail@gmail.com> | 2017-07-26 18:53:37 -0700 |
---|---|---|
committer | Krinkle <krinklemail@gmail.com> | 2017-07-27 03:02:09 +0000 |
commit | 3f10aa34e626bada433a68a1797c51163c320c24 (patch) | |
tree | 95fa18e13d89a89455857bba3d91b5e72c3c02ce /tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php | |
parent | 768085387e57b48d9bae2e36da0aacf6117e53be (diff) | |
download | mediawikicore-3f10aa34e626bada433a68a1797c51163c320c24.tar.gz mediawikicore-3f10aa34e626bada433a68a1797c51163c320c24.zip |
resourceloader: Include lessVars in FileModule definition summary
This already worked as expected for any module that uses the new
enableModuleContentVersion model, but for the majority of file modules
this is not yet the case for performance reasons. As such, make
sure lessVars are included in our manual tracking.
Include it conditionally to avoid changing the array for other modules,
which would needlessly invalidate their cache.
Bug: T171809
Change-Id: Ib250068e0ecfc29a09ca33c23bef901ee0482bf2
Diffstat (limited to 'tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php')
-rw-r--r-- | tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php index ded56e9201c4..e82bab72df53 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php @@ -331,4 +331,23 @@ class ResourceLoaderFileModuleTest extends ResourceLoaderTestCase { 'Leading BOM removed when concatenating files' ); } + + /** + * @covers ResourceLoaderFileModule::getDefinitionSummary + */ + public function testGetVersionHash() { + $context = $this->getResourceLoaderContext(); + + // Less variables + $module = new ResourceLoaderFileTestModule(); + $version = $module->getVersionHash( $context ); + $module = new ResourceLoaderFileTestModule( [], [ + 'lessVars' => [ 'key' => 'value' ], + ] ); + $this->assertNotEquals( + $version, + $module->getVersionHash( $context ), + 'Using less variables is significant' + ); + } } |