From: Mark A. Hershberger Date: Thu, 30 Sep 2010 01:00:16 +0000 (+0000) Subject: * Update Makefile with recommended SHELL variable X-Git-Tag: 1.31.0-rc.0~34727 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=6063e498286356b08af4e21dccb05c839eeba254;p=lhc%2Fweb%2Fwiklou.git * 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. --- diff --git a/maintenance/tests/phpunit/Makefile b/maintenance/tests/phpunit/Makefile index 7c0549dd6f..1f6539ee07 100644 --- a/maintenance/tests/phpunit/Makefile +++ b/maintenance/tests/phpunit/Makefile @@ -1,6 +1,7 @@ .PHONY: help test phpunit install coverage -CONFIG_FILE = suite.xml +SHELL = /bin/sh +CONFIG_FILE = $(shell pwd)/suite.xml FLAGS = PU = phpunit --configuration ${CONFIG_FILE} diff --git a/maintenance/tests/phpunit/includes/ExtraParserTest.php b/maintenance/tests/phpunit/includes/ExtraParserTest.php index a772d31e37..0f317ea37d 100644 --- a/maintenance/tests/phpunit/includes/ExtraParserTest.php +++ b/maintenance/tests/phpunit/includes/ExtraParserTest.php @@ -2,12 +2,16 @@ /** * Parser-related tests that don't suit for parserTests.txt */ - + class ExtraParserTest extends PHPUnit_Framework_TestCase { function setUp() { global $wgMemc; + global $wgContLang; + global $wgShowDBErrorBacktrace; + $wgShowDBErrorBacktrace = true; + if ( $wgContLang === null ) $wgContLang = new Language; $wgMemc = new FakeMemCachedClient; } @@ -24,7 +28,7 @@ class ExtraParserTest extends PHPUnit_Framework_TestCase { $parser = new Parser(); $t = Title::newFromText( 'Unit test' ); $options = new ParserOptions(); - $this->assertEquals( "

$longLine

", + $this->assertEquals( "

$longLine

", $parser->parse( $longLine, $t, $options )->getText() ); } }