r74009 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74008‎ | r74009 | r74010 >
Date:01:00, 30 September 2010
Author:mah
Status:ok (Comments)
Tags:
Comment:
* Update Makefile with recommended SHELL variable
* Use $(shell pwd) so that if the makefile is executed with ‘-C path',
it will find the suite.xml

* Update ExtraParserTest with a sane-for-testing default for
$wgShowDBErrorBacktrace
* Set $wgContLang if for some reasaon, it is null.
Modified paths:
  • /trunk/phase3/maintenance/tests/phpunit/Makefile (modified) (history)
  • /trunk/phase3/maintenance/tests/phpunit/includes/ExtraParserTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/includes/ExtraParserTest.php
@@ -2,12 +2,16 @@
33 /**
44 * Parser-related tests that don't suit for parserTests.txt
55 */
6 -
 6+
77 class ExtraParserTest extends PHPUnit_Framework_TestCase {
88
99 function setUp() {
1010 global $wgMemc;
 11+ global $wgContLang;
 12+ global $wgShowDBErrorBacktrace;
1113
 14+ $wgShowDBErrorBacktrace = true;
 15+ if ( $wgContLang === null ) $wgContLang = new Language;
1216 $wgMemc = new FakeMemCachedClient;
1317 }
1418
@@ -24,7 +28,7 @@
2529 $parser = new Parser();
2630 $t = Title::newFromText( 'Unit test' );
2731 $options = new ParserOptions();
28 - $this->assertEquals( "<p>$longLine</p>",
 32+ $this->assertEquals( "<p>$longLine</p>",
2933 $parser->parse( $longLine, $t, $options )->getText() );
3034 }
3135 }
Index: trunk/phase3/maintenance/tests/phpunit/Makefile
@@ -1,6 +1,7 @@
22 .PHONY: help test phpunit install coverage
33
4 -CONFIG_FILE = suite.xml
 4+SHELL = /bin/sh
 5+CONFIG_FILE = $(shell pwd)/suite.xml
56 FLAGS =
67 PU = phpunit --configuration ${CONFIG_FILE}
78

Comments

#Comment by Hashar (talk | contribs)   19:00, 30 September 2010

OK for Makefile : thanks for the -C switch !

About $wgContLang : - should we add it to bootstrap.php ? - some other tests use another way to construct $wgContLang : $wgContLang = Language::factory( 'en' );

Status & tagging log