3 require_once( dirname( __FILE__
) . '/ParserHelpers.php' );
4 require_once( dirname(dirname(dirname( __FILE__
))) . '/bootstrap.php' );
11 class MediaWikiParserTest
extends MediaWikiTestCase
{
12 public $count; // Number of tests in the suite.
13 public $articles = array(); // Array of test articles defined by the tests
18 $wgContLang = Language
::factory( 'en' );
20 $this->pt
= new PHPUnitParserTest
;
21 $this->pt
->setupDatabase();
26 if( is_object( $this->pt
) && $this->pt
instanceof PHPUnitParserTest
) {
27 $this->pt
->teardownDatabase();
33 public function testParserTests() {
35 //$wgParserTestFiles = array( "$IP/tests/parser/testparserTests.txt" );
37 global $wgParserTestFiles;
39 foreach( $wgParserTestFiles as $file ) {
41 $iter = new TestFileIterator( $file, $this->pt
);
44 foreach( $iter as $test ) {
45 $r = $this->pt
->runTest( $test['test'], $test['input'],
46 $test['result'], $test['options'], $test['config']
49 $this->assertTrue( $r, 'Parser test ' . $test['test'] );
53 catch( DBQueryError
$e ) {
54 $this->assertTrue( false, 'Parser test ' . $test['test'] . ' (error: "' . $e->getMessage() . '")' );
55 //This is annoying... it always stops on error and doesn't go to the next one.