Tweak SpecialRecentChangesQuery hook. Need to be able to modify selected fields on...
[mediawiki.git] / maintenance / tests / MediaWikiParserTest.php
blob121e11aa18b9ae01dbba55424681c422f3be3412
1 <?php
3 class MediaWikiParserTestSuite extends PHPUnit_Framework_TestSuite {
4 private $count;
5 public $backend;
7 public static function suite() {
8 return new self;
11 public function __construct() {
12 $this->backend = new ParserTestSuiteBackend;
13 parent::__construct();
14 $this->setName( 'Parser tests' );
17 public function run( PHPUnit_Framework_TestResult $result = null, $filter = false,
18 array $groups = array(), array $excludeGroups = array(), $processIsolation = false
19 ) {
20 global $IP, $wgContLang, $wgMemc;
21 $wgContLang = Language::factory( 'en' );
22 $wgMemc = new FakeMemCachedClient;
23 $this->backend->setupDatabase();
25 $iter = new TestFileIterator( "$IP/maintenance/parserTests.txt" );
26 $iter->setParser( $this->backend );
27 $this->count = 0;
29 foreach ( $iter as $test ) {
30 $this->addTest( new ParserUnitTest( $this, $test ) );
31 $this->count++;
34 parent::run( $result, $filter, $groups, $excludeGroups, $processIsolation );
36 $this->backend->teardownDatabase();
39 public function count() {
40 return $this->count;
43 public function toString() {
44 return "MediaWiki Parser Tests";
47 public function getBackend() {
48 return $this->backend;
51 public function getIterator() {
52 return $this->iterator;