Don't look for pipes in the root node.
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / MediaWikiParserTest.php
1 <?php
2
3 require_once( dirname( __FILE__ ) . '/ParserHelpers.php' );
4 require_once( dirname(dirname(dirname( __FILE__ ))) . '/bootstrap.php' );
5
6 /**
7 * @group Parser
8 * @group Destructive
9 * @group Database
10 * @group Broken
11 * It's not really broken, but superseded
12 */
13 class MediaWikiParserTest extends MediaWikiTestCase {
14 public $count; // Number of tests in the suite.
15 public $articles = array(); // Array of test articles defined by the tests
16 protected $pt;
17
18 function setUp() {
19 global $wgContLang;
20 $wgContLang = Language::factory( 'en' );
21
22 $this->pt = new PHPUnitParserTest;
23 $this->pt->setupDatabase();
24
25 }
26
27 function tearDown() {
28 if( is_object( $this->pt ) && $this->pt instanceof PHPUnitParserTest ) {
29 $this->pt->teardownDatabase();
30 $this->pt = null;
31 }
32 }
33
34
35 public function testParserTests() {
36 //global $IP;
37 //$wgParserTestFiles = array( "$IP/tests/parser/testparserTests.txt" );
38
39 global $wgParserTestFiles;
40
41 foreach( $wgParserTestFiles as $file ) {
42
43 $iter = new TestFileIterator( $file, $this->pt );
44
45 try {
46 foreach( $iter as $test ) {
47 $r = $this->pt->runTest( $test['test'], $test['input'],
48 $test['result'], $test['options'], $test['config']
49 );
50
51 $this->assertTrue( $r, 'Parser test ' . $test['test'] );
52
53 }
54 }
55 catch( DBQueryError $e ) {
56 $this->assertTrue( false, 'Parser test ' . $test['test'] . ' (error: "' . $e->getMessage() . '")' );
57 //This is annoying... it always stops on error and doesn't go to the next one.
58 continue;
59 }
60
61 }
62
63 }
64
65 }
66