Absolutize require paths per r72858 CR.
[lhc/web/wiklou.git] / maintenance / tests / phpunit / includes / parser / MediaWikiParserTest.php
1 <?php
2
3 require_once( dirname( __FILE__ ) . '/ParserHelpers.php' );
4
5 class MediaWikiParserTestSuite extends PHPUnit_Framework_TestSuite {
6 private $count;
7 public $backend;
8
9 public static function suite() {
10 return new self;
11 }
12
13 public function __construct() {
14 $this->backend = new ParserTestSuiteBackend;
15 parent::__construct();
16 $this->setName( 'Parser tests' );
17 }
18
19 public function run( PHPUnit_Framework_TestResult $result = null, $filter = false,
20 array $groups = array(), array $excludeGroups = array(), $processIsolation = false
21 ) {
22 global $IP, $wgContLang, $wgMemc;
23 $wgContLang = Language::factory( 'en' );
24 $wgMemc = new FakeMemCachedClient;
25 $this->backend->setupDatabase();
26
27 $iter = new TestFileIterator( "$IP/maintenance/parserTests.txt" );
28 $iter->setParser( $this->backend );
29 $this->count = 0;
30
31 foreach ( $iter as $test ) {
32 $this->addTest( new ParserUnitTest( $this, $test ) );
33 $this->count++;
34 }
35
36 parent::run( $result, $filter, $groups, $excludeGroups, $processIsolation );
37
38 $this->backend->teardownDatabase();
39 }
40
41 public function count() {
42 return $this->count;
43 }
44
45 public function toString() {
46 return "MediaWiki Parser Tests";
47 }
48
49 public function getBackend() {
50 return $this->backend;
51 }
52
53 public function getIterator() {
54 return $this->iterator;
55 }
56 }
57