From 6063e498286356b08af4e21dccb05c839eeba254 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Thu, 30 Sep 2010 01:00:16 +0000 Subject: [PATCH] =?utf8?q?*=20Update=20Makefile=20with=20recommended=20SHE?= =?utf8?q?LL=20variable=20*=20Use=20$(shell=20pwd)=20so=20that=20if=20the?= =?utf8?q?=20makefile=20is=20executed=20with=20=E2=80=98-C=20path',=20=20?= =?utf8?q?=20it=20will=20find=20the=20suite.xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * Update ExtraParserTest with a sane-for-testing default for $wgShowDBErrorBacktrace * Set $wgContLang if for some reasaon, it is null. --- maintenance/tests/phpunit/Makefile | 3 ++- maintenance/tests/phpunit/includes/ExtraParserTest.php | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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() ); } } -- 2.20.1