r93516 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93515‎ | r93516 | r93517 >
Date:07:38, 30 July 2011
Author:krinkle
Status:ok
Tags:
Comment:
Adding unit test for bug 27427. Currently broken. Fix (provided by Michael M. through BugZilla) will be committed afterwards.

* (bug 27427) mw.util.getParamValue shouldn't return value from hash even if param is only present in hash
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.util.js (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -122,6 +122,7 @@
123123 * Max Sikström
124124 * Michael Dale
125125 * Michael De La Rue
 126+* Michael M.
126127 * Michael Walsh
127128 * Mike Horvath
128129 * Mormegil
Index: trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.util.js
@@ -107,12 +107,15 @@
108108 });
109109
110110 test( 'getParamValue', function() {
111 - expect(2);
 111+ expect(3);
112112
113 - var url = 'http://mediawiki.org/?foo=wrong&foo=right#&foo=bad';
 113+ var url1 = 'http://mediawiki.org/?foo=wrong&foo=right#&foo=bad';
114114
115 - equal( mw.util.getParamValue( 'foo', url ), 'right', 'Use latest one, ignore hash' );
116 - strictEqual( mw.util.getParamValue( 'bar', url ), null, 'Return null when not found' );
 115+ equal( mw.util.getParamValue( 'foo', url1 ), 'right', 'Use latest one, ignore hash' );
 116+ strictEqual( mw.util.getParamValue( 'bar', url1 ), null, 'Return null when not found' );
 117+
 118+ var url2 = 'http://mediawiki.org/#&foo=bad';
 119+ strictEqual( mw.util.getParamValue( 'foo', url2 ), null, 'Ignore hash if param is not in querystring but in hash (bug 27427)' );
117120 });
118121
119122 test( 'tooltipAccessKey', function() {

Follow-up revisions

RevisionCommit summaryAuthorDate
r93517Adding fix for bug 27427. Fixes unit test. Patch provided by Michael M. throu...krinkle07:39, 30 July 2011
r94446MFT to REL1_18:...hashar09:27, 14 August 2011

Status & tagging log