r89666 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89665‎ | r89666 | r89667 >
Date:17:56, 7 June 2011
Author:brion
Status:ok
Tags:
Comment:
Added phpunit test cases for r87497, r88076: ResourceLoader module name prefix collapsing
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/ResourceLoaderTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/ResourceLoaderTest.php
@@ -46,6 +46,40 @@
4747 $resourceLoader->register( $name, $module );
4848 $this->assertEquals( $module, $resourceLoader->getModule( $name ) );
4949 }
 50+
 51+ /**
 52+ * @dataProvider providePackedModules
 53+ */
 54+ public function testMakePackedModulesString( $desc, $modules, $packed ) {
 55+ $this->assertEquals( $packed, ResourceLoader::makePackedModulesString( $modules ), $desc );
 56+ }
 57+
 58+ /**
 59+ * @dataProvider providePackedModules
 60+ */
 61+ public function testexpandModuleNames( $desc, $modules, $packed ) {
 62+ $this->assertEquals( $modules, ResourceLoaderContext::expandModuleNames( $packed ), $desc );
 63+ }
 64+
 65+ public function providePackedModules() {
 66+ return array(
 67+ array(
 68+ 'Example from makePackedModulesString doc comment',
 69+ array( 'foo.bar', 'foo.baz', 'bar.baz', 'bar.quux' ),
 70+ 'foo.bar,baz|bar.baz,quux',
 71+ ),
 72+ array(
 73+ 'Example from expandModuleNames doc comment',
 74+ array( 'jquery.foo', 'jquery.bar', 'jquery.ui.baz', 'jquery.ui.quux' ),
 75+ 'jquery.foo,bar|jquery.ui.baz,quux',
 76+ ),
 77+ array(
 78+ 'Regression fixed in r88706 with dotless names',
 79+ array( 'foo', 'bar', 'baz' ),
 80+ 'foo,bar,baz',
 81+ )
 82+ );
 83+ }
5084 }
5185
5286 /* Stubs */

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87497Per bug 28738 comment 4, pack ResourceLoader URLs by encoding foo.bar|foo.baz...catrope13:46, 5 May 2011
r88076Fix bug in r87497, reported in CR: &modules=foo,bar,baz would look for '.foo'...catrope13:34, 14 May 2011

Status & tagging log