mediawiki.Uri: Support names of Object prototypes as keys in query
[lhc/web/wiklou.git] / tests / qunit / suites / resources / mediawiki / mediawiki.Uri.test.js
index 51374bd..63de2fd 100644 (file)
@@ -60,7 +60,7 @@
                } );
        } );
 
-       QUnit.test( 'Constructor( String[, Object ] )', 10, function ( assert ) {
+       QUnit.test( 'Constructor( String[, Object ] )', 11, function ( assert ) {
                var uri;
 
                uri = new mw.Uri( 'http://www.example.com/dir/?m=foo&m=bar&n=1', {
                        strictMode: false
                } );
                assert.equal( uri.toString(), 'http://example.com/bar/baz', 'normalize URI without protocol or // in loose mode' );
+
+               /*jshint -W001 */
+               uri = new mw.Uri( 'http://example.com/index.php?key=key&hasOwnProperty=hasOwnProperty&constructor=constructor&watch=watch' );
+               assert.deepEqual(
+                       uri.query,
+                       {
+                               key: 'key',
+                               constructor: 'constructor',
+                               hasOwnProperty: 'hasOwnProperty',
+                               watch: 'watch'
+                       },
+                       'Keys in query strings support names of Object prototypes (bug T114344)'
+               );
+               /*jshint +W001 */
        } );
 
        QUnit.test( 'Constructor( Object )', 3, function ( assert ) {