r85553 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85552‎ | r85553 | r85554 >
Date:17:39, 6 April 2011
Author:happy-melon
Status:resolved (Comments)
Tags:
Comment:
Follow-up r85403: fix fatal in parser tests.
Modified paths:
  • /trunk/phase3/tests/parser/parserTest.inc (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php
@@ -295,6 +295,9 @@
296296 $GLOBALS[$var] = $val;
297297 }
298298
 299+ $langObj = Language::factory( $lang );
 300+ $GLOBALS['wgContLang'] = $langObj;
 301+
299302 $context = new RequestContext();
300303 $GLOBALS['wgLang'] = $context->lang;
301304 $GLOBALS['wgContLang'] = $context->lang;
Index: trunk/phase3/tests/parser/parserTest.inc
@@ -680,6 +680,9 @@
681681 $GLOBALS[$var] = $val;
682682 }
683683
 684+ $langObj = Language::factory( $lang );
 685+ $GLOBALS['wgContLang'] = $langObj;
 686+
684687 $context = new RequestContext();
685688 $GLOBALS['wgLang'] = $context->lang;
686689 $GLOBALS['wgContLang'] = $context->lang;

Follow-up revisions

RevisionCommit summaryAuthorDate
r85581r85553 fixup. When there are variants involved, the line...platonides21:36, 6 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85403Follow-up r85302: update OutputPage constructors in core.happy-melon00:06, 5 April 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   19:12, 6 April 2011

This doesn't seem to have fixed everything; while the tests now run, 13 tests fail that didn't in r85301 before this stuff changed, mostly related to LanguageConverter which may indicate that language objects still are off somehow:

 13 new FAILING test(s) :(
     * Prevent conversion with -{}- tags (language variants)  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]
     * Prevent conversion of text with -{}- tags (language variants)  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]
     * Prevent conversion of links with -{}- tags (language variants)  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]
     * -{}- tags within headlines (within html for parserConvert())  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]
     * Explicit definition of language variant alternatives  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]
     * Explicit session-wise language variant mapping (A flag and - flag)  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]
     * Explicit session-wise language variant mapping (H flag for hide)  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]
     * Adding explicit conversion rule for title (T flag)  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]
     * Bug 24072: more test on conversion rule for title  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]
     * Raw output of variant escape tags (R flag)  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]
     * Nested using of manual convert syntax  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]
     * Do not convert roman numbers to language variants  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]
     * Edit comment with bare anchor link (local, as on diff)  [Introduced between 06-Apr-2011 19:06:48, 1.18alpha (r85302) and 06-Apr-2011 19:10:58, 1.18alpha (r85562)]

Passed 641 of 654 tests (98.01%)... 13 tests failed!

Also it seems odd to set $wgContLang to $langObj, then set it to $context->lang immediately after. If that's because something in RequestContext()'s constructure requires $wgContLang to be set, then you should mention this in a comment so someone else doesn't come along and remove it, thinking it's redundant.

#Comment by Platonides (talk | contribs)   21:36, 6 April 2011

Fixed in r85581. The $GLOBALS['wgContLang'] = $context->lang; was really unneeded, and the cause of the bug (when there's a code override).

#Comment by Brion VIBBER (talk | contribs)   21:43, 6 April 2011

Woot, thanks!

The 'edit comment with bare anchor link' still fails, but that looks unrelated. Others are all now A-OK.

#Comment by Platonides (talk | contribs)   22:32, 6 April 2011

See r85582. :)

I had inadvertedly broken it in r85481

Status & tagging log