3 var repeat = function ( input
, multiplier
) {
4 return new Array( multiplier
+ 1 ).join( input
);
7 // See also TitleTest.php#testSecureAndSplit
19 'File_talk:Example.svg',
24 // Length is 256 total, but only title part matters
25 'Category:' + repeat( 'x', 248 ),
33 // Bad characters forbidden regardless of wgLegalTitleChars
45 // XML/HTML character entity references
46 // Note: The ones with # are commented out as those are interpreted as fragment and
47 // as such end up being valid.
51 // Subject of NS_TALK does not roundtrip to NS_MAIN
52 'Talk:File:Example.svg',
53 // Directory navigation
67 // Extension separation is a js invention, for length
68 // purposes it is part of the title
69 repeat( 'x', 252 ) + '.json',
70 // Namespace prefix without actual title
77 QUnit
.module( 'mediawiki.Title', QUnit
.newMwEnvironment( {
78 // mw.Title relies on these three config vars
79 // Restore them after each test run
81 wgFormattedNamespaces
: {
100 // testing custom / localized namespace
103 // jscs: disable requireCamelCaseOrUpperCaseIdentifiers
127 // Testing custom namespaces and aliases
129 antarctic_waterfowl
: 100
131 // jscs: enable requireCamelCaseOrUpperCaseIdentifiers
132 wgCaseSensitiveNamespaces
: []
136 QUnit
.test( 'constructor', cases
.invalid
.length
, function ( assert
) {
138 for ( i
= 0; i
< cases
.valid
.length
; i
++ ) {
139 title
= new mw
.Title( cases
.valid
[ i
] );
141 for ( i
= 0; i
< cases
.invalid
.length
; i
++ ) {
142 /*jshint loopfunc:true */
143 title
= cases
.invalid
[ i
];
144 assert
.throws( function () {
145 return new mw
.Title( title
);
146 }, cases
.invalid
[ i
] );
150 QUnit
.test( 'newFromText', cases
.valid
.length
+ cases
.invalid
.length
, function ( assert
) {
152 for ( i
= 0; i
< cases
.valid
.length
; i
++ ) {
154 $.type( mw
.Title
.newFromText( cases
.valid
[ i
] ) ),
159 for ( i
= 0; i
< cases
.invalid
.length
; i
++ ) {
161 $.type( mw
.Title
.newFromText( cases
.invalid
[ i
] ) ),
168 QUnit
.test( 'Basic parsing', 21, function ( assert
) {
170 title
= new mw
.Title( 'File:Foo_bar.JPG' );
172 assert
.equal( title
.getNamespaceId(), 6 );
173 assert
.equal( title
.getNamespacePrefix(), 'File:' );
174 assert
.equal( title
.getName(), 'Foo_bar' );
175 assert
.equal( title
.getNameText(), 'Foo bar' );
176 assert
.equal( title
.getExtension(), 'JPG' );
177 assert
.equal( title
.getDotExtension(), '.JPG' );
178 assert
.equal( title
.getMain(), 'Foo_bar.JPG' );
179 assert
.equal( title
.getMainText(), 'Foo bar.JPG' );
180 assert
.equal( title
.getPrefixedDb(), 'File:Foo_bar.JPG' );
181 assert
.equal( title
.getPrefixedText(), 'File:Foo bar.JPG' );
183 title
= new mw
.Title( 'Foo#bar' );
184 assert
.equal( title
.getPrefixedText(), 'Foo' );
185 assert
.equal( title
.getFragment(), 'bar' );
187 title
= new mw
.Title( '.foo' );
188 assert
.equal( title
.getPrefixedText(), '.foo' );
189 assert
.equal( title
.getName(), '' );
190 assert
.equal( title
.getNameText(), '' );
191 assert
.equal( title
.getExtension(), 'foo' );
192 assert
.equal( title
.getDotExtension(), '.foo' );
193 assert
.equal( title
.getMain(), '.foo' );
194 assert
.equal( title
.getMainText(), '.foo' );
195 assert
.equal( title
.getPrefixedDb(), '.foo' );
196 assert
.equal( title
.getPrefixedText(), '.foo' );
199 QUnit
.test( 'Transformation', 11, function ( assert
) {
202 title
= new mw
.Title( 'File:quux pif.jpg' );
203 assert
.equal( title
.getNameText(), 'Quux pif', 'First character of title' );
205 title
= new mw
.Title( 'File:Glarg_foo_glang.jpg' );
206 assert
.equal( title
.getNameText(), 'Glarg foo glang', 'Underscores' );
208 title
= new mw
.Title( 'User:ABC.DEF' );
209 assert
.equal( title
.toText(), 'User:ABC.DEF', 'Round trip text' );
210 assert
.equal( title
.getNamespaceId(), 2, 'Parse canonical namespace prefix' );
212 title
= new mw
.Title( 'Image:quux pix.jpg' );
213 assert
.equal( title
.getNamespacePrefix(), 'File:', 'Transform alias to canonical namespace' );
215 title
= new mw
.Title( 'uSEr:hAshAr' );
216 assert
.equal( title
.toText(), 'User:HAshAr' );
217 assert
.equal( title
.getNamespaceId(), 2, 'Case-insensitive namespace prefix' );
219 // Don't ask why, it's the way the backend works. One space is kept of each set.
220 title
= new mw
.Title( 'Foo __ \t __ bar' );
221 assert
.equal( title
.getMain(), 'Foo_bar', 'Merge multiple types of whitespace/underscores into a single underscore' );
223 // Regression test: Previously it would only detect an extension if there is no space after it
224 title
= new mw
.Title( 'Example.js ' );
225 assert
.equal( title
.getExtension(), 'js', 'Space after an extension is stripped' );
227 title
= new mw
.Title( 'Example#foo' );
228 assert
.equal( title
.getFragment(), 'foo', 'Fragment' );
230 title
= new mw
.Title( 'Example#_foo_bar baz_' );
231 assert
.equal( title
.getFragment(), ' foo bar baz', 'Fragment' );
234 QUnit
.test( 'Namespace detection and conversion', 10, function ( assert
) {
237 title
= new mw
.Title( 'File:User:Example' );
238 assert
.equal( title
.getNamespaceId(), 6, 'Titles can contain namespace prefixes, which are otherwise ignored' );
240 title
= new mw
.Title( 'Example', 6 );
241 assert
.equal( title
.getNamespaceId(), 6, 'Default namespace passed is used' );
243 title
= new mw
.Title( 'User:Example', 6 );
244 assert
.equal( title
.getNamespaceId(), 2, 'Included namespace prefix overrides the given default' );
246 title
= new mw
.Title( ':Example', 6 );
247 assert
.equal( title
.getNamespaceId(), 0, 'Colon forces main namespace' );
249 title
= new mw
.Title( 'something.PDF', 6 );
250 assert
.equal( title
.toString(), 'File:Something.PDF' );
252 title
= new mw
.Title( 'NeilK', 3 );
253 assert
.equal( title
.toString(), 'User_talk:NeilK' );
254 assert
.equal( title
.toText(), 'User talk:NeilK' );
256 title
= new mw
.Title( 'Frobisher', 100 );
257 assert
.equal( title
.toString(), 'Penguins:Frobisher' );
259 title
= new mw
.Title( 'antarctic_waterfowl:flightless_yet_cute.jpg' );
260 assert
.equal( title
.toString(), 'Penguins:Flightless_yet_cute.jpg' );
262 title
= new mw
.Title( 'Penguins:flightless_yet_cute.jpg' );
263 assert
.equal( title
.toString(), 'Penguins:Flightless_yet_cute.jpg' );
266 QUnit
.test( 'Throw error on invalid title', 1, function ( assert
) {
267 assert
.throws( function () {
268 return new mw
.Title( '' );
269 }, 'Throw error on empty string' );
272 QUnit
.test( 'Case-sensivity', 3, function ( assert
) {
276 mw
.config
.set( 'wgCaseSensitiveNamespaces', [] );
278 title
= new mw
.Title( 'article' );
279 assert
.equal( title
.toString(), 'Article', 'Default config: No sensitive namespaces by default. First-letter becomes uppercase' );
281 // $wgCapitalLinks = false;
282 mw
.config
.set( 'wgCaseSensitiveNamespaces', [ 0, -2, 1, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15 ] );
284 title
= new mw
.Title( 'article' );
285 assert
.equal( title
.toString(), 'article', '$wgCapitalLinks=false: Article namespace is sensitive, first-letter case stays lowercase' );
287 title
= new mw
.Title( 'john', 2 );
288 assert
.equal( title
.toString(), 'User:John', '$wgCapitalLinks=false: User namespace is insensitive, first-letter becomes uppercase' );
291 QUnit
.test( 'toString / toText', 2, function ( assert
) {
292 var title
= new mw
.Title( 'Some random page' );
294 assert
.equal( title
.toString(), title
.getPrefixedDb() );
295 assert
.equal( title
.toText(), title
.getPrefixedText() );
298 QUnit
.test( 'getExtension', 7, function ( assert
) {
299 function extTest( pagename
, ext
, description
) {
300 var title
= new mw
.Title( pagename
);
301 assert
.equal( title
.getExtension(), ext
, description
|| pagename
);
304 extTest( 'MediaWiki:Vector.js', 'js' );
305 extTest( 'User:Example/common.css', 'css' );
306 extTest( 'File:Example.longextension', 'longextension', 'Extension parsing not limited (bug 36151)' );
307 extTest( 'Example/information.json', 'json', 'Extension parsing not restricted from any namespace' );
308 extTest( 'Foo.', null, 'Trailing dot is not an extension' );
309 extTest( 'Foo..', null, 'Trailing dots are not an extension' );
310 extTest( 'Foo.a.', null, 'Page name with dots and ending in a dot does not have an extension' );
312 // @broken: Throws an exception
313 // extTest( '.NET', null, 'Leading dot is (or is not?) an extension' );
316 QUnit
.test( 'exists', 3, function ( assert
) {
319 // Empty registry, checks default to null
321 title
= new mw
.Title( 'Some random page', 4 );
322 assert
.strictEqual( title
.exists(), null, 'Return null with empty existance registry' );
324 // Basic registry, checks default to boolean
325 mw
.Title
.exist
.set( [ 'Does_exist', 'User_talk:NeilK', 'Wikipedia:Sandbox_rules' ], true );
326 mw
.Title
.exist
.set( [ 'Does_not_exist', 'User:John', 'Foobar' ], false );
328 title
= new mw
.Title( 'Project:Sandbox rules' );
329 assert
.assertTrue( title
.exists(), 'Return true for page titles marked as existing' );
330 title
= new mw
.Title( 'Foobar' );
331 assert
.assertFalse( title
.exists(), 'Return false for page titles marked as nonexistent' );
335 QUnit
.test( 'getUrl', 3, function ( assert
) {
339 mw
.config
.set( 'wgArticlePath', '/wiki/$1' );
341 title
= new mw
.Title( 'Foobar' );
342 assert
.equal( title
.getUrl(), '/wiki/Foobar', 'Basic functionality, getUrl uses mw.util.getUrl' );
343 assert
.equal( title
.getUrl( { action
: 'edit' } ), '/wiki/Foobar?action=edit', 'Basic functionality, \'params\' parameter' );
345 title
= new mw
.Title( 'John Doe', 3 );
346 assert
.equal( title
.getUrl(), '/wiki/User_talk:John_Doe', 'Escaping in title and namespace for urls' );
349 QUnit
.test( 'newFromImg', 40, function ( assert
) {
350 var title
, i
, thisCase
, prefix
,
353 url
: '//upload.wikimedia.org/wikipedia/commons/thumb/b/bf/Princess_Alexandra_of_Denmark_%28later_Queen_Alexandra%2C_wife_of_Edward_VII%29_with_her_two_eldest_sons%2C_Prince_Albert_Victor_%28Eddy%29_and_George_Frederick_Ernest_Albert_%28later_George_V%29.jpg/939px-thumbnail.jpg',
354 typeOfUrl
: 'Hashed thumb with shortened path',
355 nameText
: 'Princess Alexandra of Denmark (later Queen Alexandra, wife of Edward VII) with her two eldest sons, Prince Albert Victor (Eddy) and George Frederick Ernest Albert (later George V)',
356 prefixedText
: 'File:Princess Alexandra of Denmark (later Queen Alexandra, wife of Edward VII) with her two eldest sons, Prince Albert Victor (Eddy) and George Frederick Ernest Albert (later George V).jpg'
359 url
: '/wiki/images/thumb/9/91/Anticlockwise_heliotrope%27s.jpg/99px-Anticlockwise_heliotrope%27s.jpg',
360 typeOfUrl
: 'Normal hashed directory thumbnail',
361 nameText
: 'Anticlockwise heliotrope\'s',
362 prefixedText
: 'File:Anticlockwise heliotrope\'s.jpg'
366 url
: '/wiki/images/thumb/8/80/Wikipedia-logo-v2.svg/langde-150px-Wikipedia-logo-v2.svg.png',
367 typeOfUrl
: 'Normal hashed directory thumbnail with complex thumbnail parameters',
368 nameText
: 'Wikipedia-logo-v2',
369 prefixedText
: 'File:Wikipedia-logo-v2.svg'
373 url
: '//upload.wikimedia.org/wikipedia/commons/thumb/8/80/Wikipedia-logo-v2.svg/150px-Wikipedia-logo-v2.svg.png',
374 typeOfUrl
: 'Commons thumbnail',
375 nameText
: 'Wikipedia-logo-v2',
376 prefixedText
: 'File:Wikipedia-logo-v2.svg'
380 url
: '/wiki/images/9/91/Anticlockwise_heliotrope%27s.jpg',
381 typeOfUrl
: 'Full image',
382 nameText
: 'Anticlockwise heliotrope\'s',
383 prefixedText
: 'File:Anticlockwise heliotrope\'s.jpg'
387 url
: 'http://localhost/thumb.php?f=Stuffless_Figaro%27s.jpg&width=180',
388 typeOfUrl
: 'thumb.php-based thumbnail',
389 nameText
: 'Stuffless Figaro\'s',
390 prefixedText
: 'File:Stuffless Figaro\'s.jpg'
394 url
: '/wikipedia/commons/thumb/Wikipedia-logo-v2.svg/150px-Wikipedia-logo-v2.svg.png',
395 typeOfUrl
: 'Commons unhashed thumbnail',
396 nameText
: 'Wikipedia-logo-v2',
397 prefixedText
: 'File:Wikipedia-logo-v2.svg'
401 url
: '/wikipedia/commons/thumb/Wikipedia-logo-v2.svg/langde-150px-Wikipedia-logo-v2.svg.png',
402 typeOfUrl
: 'Commons unhashed thumbnail with complex thumbnail parameters',
403 nameText
: 'Wikipedia-logo-v2',
404 prefixedText
: 'File:Wikipedia-logo-v2.svg'
408 url
: '/wiki/images/Anticlockwise_heliotrope%27s.jpg',
409 typeOfUrl
: 'Unhashed local file',
410 nameText
: 'Anticlockwise heliotrope\'s',
411 prefixedText
: 'File:Anticlockwise heliotrope\'s.jpg'
416 typeOfUrl
: 'Empty string'
421 typeOfUrl
: 'String with only alphabet characters'
425 url
: 'foobar.foobar',
426 typeOfUrl
: 'Not a file path'
430 url
: '/a/a0/blah blah blah',
431 typeOfUrl
: 'Space characters'
435 for ( i
= 0; i
< cases
.length
; i
++ ) {
436 thisCase
= cases
[ i
];
437 title
= mw
.Title
.newFromImg( { src
: thisCase
.url
} );
439 if ( thisCase
.nameText
!== undefined ) {
440 prefix
= '[' + thisCase
.typeOfUrl
+ ' URL' + '] ';
442 assert
.notStrictEqual( title
, null, prefix
+ 'Parses successfully' );
443 assert
.equal( title
.getNameText(), thisCase
.nameText
, prefix
+ 'Filename matches original' );
444 assert
.equal( title
.getPrefixedText(), thisCase
.prefixedText
, prefix
+ 'File page title matches original' );
445 assert
.equal( title
.getNamespaceId(), 6, prefix
+ 'Namespace ID matches File namespace' );
447 assert
.strictEqual( title
, null, thisCase
.typeOfUrl
+ ', should not produce an mw.Title object' );
452 QUnit
.test( 'getRelativeText', 5, function ( assert
) {
453 var i
, thisCase
, title
,
458 expectedResult
: ':Asd'
463 expectedResult
: 'Dfg'
466 text
: 'Template:Ghj',
468 expectedResult
: 'Template:Ghj'
478 expectedResult
: 'User:Hi'
482 for ( i
= 0; i
< cases
.length
; i
++ ) {
483 thisCase
= cases
[ i
];
485 title
= mw
.Title
.newFromText( thisCase
.text
);
486 assert
.equal( title
.getRelativeText( thisCase
.relativeTo
), thisCase
.expectedResult
);
490 QUnit
.test( 'normalizeExtension', 5, function ( assert
) {
491 var extension
, i
, thisCase
, prefix
,
496 description
: 'Extension already in canonical form'
501 description
: 'Extension lowercased in canonical form'
506 description
: 'Extension changed in canonical form'
511 description
: 'Extension lowercased and changed in canonical form'
516 description
: 'Extension invalid and discarded'
520 for ( i
= 0; i
< cases
.length
; i
++ ) {
521 thisCase
= cases
[ i
];
522 extension
= mw
.Title
.normalizeExtension( thisCase
.extension
);
524 prefix
= '[' + thisCase
.description
+ '] ';
525 assert
.equal( extension
, thisCase
.expected
, prefix
+ 'Extension as expected' );
529 QUnit
.test( 'newFromUserInput', 12, function ( assert
) {
530 var title
, i
, thisCase
, prefix
,
533 title
: 'DCS0001557854455.JPG',
534 expected
: 'DCS0001557854455.JPG',
535 description
: 'Title in normal namespace without anything invalid but with "file extension"'
538 title
: 'MediaWiki:Msg-awesome',
539 expected
: 'MediaWiki:Msg-awesome',
540 description
: 'Full title (page in MediaWiki namespace) supplied as string'
543 title
: 'The/Mw/Sound.flac',
544 defaultNamespace
: -2,
545 expected
: 'Media:The-Mw-Sound.flac',
546 description
: 'Page in Media-namespace without explicit options'
549 title
: 'File:The/Mw/Sound.kml',
554 expected
: 'File:The/Mw/Sound.kml',
555 description
: 'Page in File-namespace without explicit options'
558 title
: 'File:Foo.JPEG',
559 expected
: 'File:Foo.JPEG',
560 description
: 'Page in File-namespace with non-canonical extension'
563 title
: 'File:Foo.JPEG ',
564 expected
: 'File:Foo.JPEG',
565 description
: 'Page in File-namespace with trailing whitespace'
569 for ( i
= 0; i
< cases
.length
; i
++ ) {
570 thisCase
= cases
[ i
];
571 title
= mw
.Title
.newFromUserInput( thisCase
.title
, thisCase
.defaultNamespace
, thisCase
.options
);
573 if ( thisCase
.expected
!== undefined ) {
574 prefix
= '[' + thisCase
.description
+ '] ';
576 assert
.notStrictEqual( title
, null, prefix
+ 'Parses successfully' );
577 assert
.equal( title
.toText(), thisCase
.expected
, prefix
+ 'Title as expected' );
579 assert
.strictEqual( title
, null, thisCase
.description
+ ', should not produce an mw.Title object' );
584 QUnit
.test( 'newFromFileName', 54, function ( assert
) {
585 var title
, i
, thisCase
, prefix
,
588 fileName
: 'DCS0001557854455.JPG',
589 typeOfName
: 'Standard camera output',
590 nameText
: 'DCS0001557854455',
591 prefixedText
: 'File:DCS0001557854455.JPG'
594 fileName
: 'File:Sample.png',
595 typeOfName
: 'Carrying namespace',
596 nameText
: 'File-Sample',
597 prefixedText
: 'File:File-Sample.png'
600 fileName
: 'Treppe 2222 Test upload.jpg',
601 typeOfName
: 'File name with spaces in it and lower case file extension',
602 nameText
: 'Treppe 2222 Test upload',
603 prefixedText
: 'File:Treppe 2222 Test upload.jpg'
606 fileName
: 'I contain a \ttab.jpg',
607 typeOfName
: 'Name containing a tab character',
608 nameText
: 'I contain a tab',
609 prefixedText
: 'File:I contain a tab.jpg'
612 fileName
: 'I_contain multiple__ ___ _underscores.jpg',
613 typeOfName
: 'Name containing multiple underscores',
614 nameText
: 'I contain multiple underscores',
615 prefixedText
: 'File:I contain multiple underscores.jpg'
618 fileName
: 'I like ~~~~~~~~es.jpg',
619 typeOfName
: 'Name containing more than three consecutive tilde characters',
620 nameText
: 'I like ~~es',
621 prefixedText
: 'File:I like ~~es.jpg'
624 fileName
: 'BI\u200EDI.jpg',
625 typeOfName
: 'Name containing BIDI overrides',
627 prefixedText
: 'File:BIDI.jpg'
630 fileName
: '100%ab progress.jpg',
631 typeOfName
: 'File name with URL encoding',
632 nameText
: '100% ab progress',
633 prefixedText
: 'File:100% ab progress.jpg'
636 fileName
: '<([>]):/#.jpg',
637 typeOfName
: 'File name with characters not permitted in titles that are replaced',
638 nameText
: '((()))---',
639 prefixedText
: 'File:((()))---.jpg'
642 fileName
: 'spaces\u0009\u2000\u200A\u200Bx.djvu',
643 typeOfName
: 'File name with different kind of spaces',
644 nameText
: 'Spaces \u200Bx',
645 prefixedText
: 'File:Spaces \u200Bx.djvu'
648 fileName
: 'dot.dot.dot.dot.dotdot',
649 typeOfName
: 'File name with a lot of dots',
650 nameText
: 'Dot.dot.dot.dot',
651 prefixedText
: 'File:Dot.dot.dot.dot.dotdot'
654 fileName
: 'dot. dot ._dot',
655 typeOfName
: 'File name with multiple dots and spaces',
656 nameText
: 'Dot. dot',
657 prefixedText
: 'File:Dot. dot. dot'
660 fileName
: '𠜎𠜱𠝹𠱓𠱸𠲖𠳏𠳕𠴕𠵼𠵿𠸎𠸏𠹷𠺝𠺢𠻗𠻹𠻺𠼭𠼮𠽌𠾴𠾼𠿪𡁜𡁯𡁵𡁶𡁻𡃁𡃉𡇙𢃇𢞵𢫕𢭃𢯊𢱑𢱕𢳂𠻹𠻺𠼭𠼮𠽌𠾴𠾼𠿪𡁜𡁯𡁵𡁶𡁻𡃁𡃉𡇙𢃇𢞵𢫕𢭃𢯊𢱑𢱕𢳂.png',
661 typeOfName
: 'File name longer than 240 bytes',
662 nameText
: '𠜎𠜱𠝹𠱓𠱸𠲖𠳏𠳕𠴕𠵼𠵿𠸎𠸏𠹷𠺝𠺢𠻗𠻹𠻺𠼭𠼮𠽌𠾴𠾼𠿪𡁜𡁯𡁵𡁶𡁻𡃁𡃉𡇙𢃇𢞵𢫕𢭃𢯊𢱑𢱕𢳂𠻹𠻺𠼭𠼮𠽌𠾴𠾼𠿪𡁜𡁯𡁵𡁶𡁻𡃁𡃉𡇙𢃇𢞵',
663 prefixedText
: 'File:𠜎𠜱𠝹𠱓𠱸𠲖𠳏𠳕𠴕𠵼𠵿𠸎𠸏𠹷𠺝𠺢𠻗𠻹𠻺𠼭𠼮𠽌𠾴𠾼𠿪𡁜𡁯𡁵𡁶𡁻𡃁𡃉𡇙𢃇𢞵𢫕𢭃𢯊𢱑𢱕𢳂𠻹𠻺𠼭𠼮𠽌𠾴𠾼𠿪𡁜𡁯𡁵𡁶𡁻𡃁𡃉𡇙𢃇𢞵.png'
667 typeOfName
: 'Empty string'
671 typeOfName
: 'String with only alphabet characters'
675 for ( i
= 0; i
< cases
.length
; i
++ ) {
676 thisCase
= cases
[ i
];
677 title
= mw
.Title
.newFromFileName( thisCase
.fileName
);
679 if ( thisCase
.nameText
!== undefined ) {
680 prefix
= '[' + thisCase
.typeOfName
+ '] ';
682 assert
.notStrictEqual( title
, null, prefix
+ 'Parses successfully' );
683 assert
.equal( title
.getNameText(), thisCase
.nameText
, prefix
+ 'Filename matches original' );
684 assert
.equal( title
.getPrefixedText(), thisCase
.prefixedText
, prefix
+ 'File page title matches original' );
685 assert
.equal( title
.getNamespaceId(), 6, prefix
+ 'Namespace ID matches File namespace' );
687 assert
.strictEqual( title
, null, thisCase
.typeOfName
+ ', should not produce an mw.Title object' );
692 }( mediaWiki
, jQuery
) );