r100110 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100109‎ | r100110 | r100111 >
Date:09:01, 18 October 2011
Author:hashar
Status:ok (Comments)
Tags:
Comment:
Qunit coverage for mw.Title.js

Follow up comment on r93702 asking to cover:
new mw.Title( 'user:NeilK' );

Also added a case conversion test
Modified paths:
  • /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js
@@ -64,7 +64,7 @@
6565 });
6666
6767 test( 'Transformation', function() {
68 - expect(4);
 68+ expect(8);
6969 _titleConfig();
7070
7171 var title;
@@ -77,7 +77,13 @@
7878
7979 title = new mw.Title( 'User:ABC.DEF' );
8080 equal( title.toText(), 'User:ABC.DEF' );
 81+ equal( title.getNamespaceId(), 2 );
 82+ equal( title.getNamespacePrefix(), 'User:' );
8183
 84+ title = new mw.Title( 'uSEr:hAshAr' );
 85+ equal( title.toText(), 'User:HAshAr' );
 86+ equal( title.getNamespaceId(), 2 );
 87+
8288 title = new mw.Title( ' MediaWiki: Foo bar .js ' );
8389 // Don't ask why, it's the way the backend works. One space is kept of each set
8490 equal( title.getName(), 'Foo_bar_.js', "Merge multiple spaces to a single space." );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93702mediawiki.Title: Removing public setter functions. Title object should be imm...krinkle03:11, 2 August 2011

Comments

#Comment by Krinkle (talk | contribs)   17:13, 18 October 2011
+	equal( title.getNamespaceId(), 2 );
+	equal( title.getNamespacePrefix(), 'User:' );

That's kinda overlapping with test('Main text for filename') which tests all public methods (except for url and exists) for a 'normal' title.

Status & tagging log