* Update Makefile with recommended SHELL variable
authorMark A. Hershberger <mah@users.mediawiki.org>
Thu, 30 Sep 2010 01:00:16 +0000 (01:00 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Thu, 30 Sep 2010 01:00:16 +0000 (01:00 +0000)
* 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.

maintenance/tests/phpunit/Makefile
maintenance/tests/phpunit/includes/ExtraParserTest.php

index 7c0549d..1f6539e 100644 (file)
@@ -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}
 
index a772d31..0f317ea 100644 (file)
@@ -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( "<p>$longLine</p>", 
+               $this->assertEquals( "<p>$longLine</p>",
                        $parser->parse( $longLine, $t, $options )->getText() );
        }
  }