X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fsuites%2FParserTestTopLevelSuite.php;h=77461c5af26bbd7a8ec7caa3b2ac9ed01c7bc3bf;hb=3ee15602329dae0bb6e17c726408ad46d949f524;hp=1ea5853f9d8cad9765ff29bf56b309db76cbbcac;hpb=b79bc0a2740b991525aae355ed216e0b9dc3aa86;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/suites/ParserTestTopLevelSuite.php b/tests/phpunit/suites/ParserTestTopLevelSuite.php index 1ea5853f9d..77461c5af2 100644 --- a/tests/phpunit/suites/ParserTestTopLevelSuite.php +++ b/tests/phpunit/suites/ParserTestTopLevelSuite.php @@ -1,4 +1,5 @@ $parserTestFile ) { - $isCore = ( 0 === strpos( $parserTestFile, $mwTestDir ) ); + $isCore = ( strpos( $parserTestFile, $mwTestDir ) === 0 ); if ( $isCore && $wantsCore ) { self::debug( "included core parser tests: $parserTestFile" ); @@ -135,6 +136,7 @@ class ParserTestTopLevelSuite extends PHPUnit_Framework_TestSuite { public function setUp() { wfDebug( __METHOD__ ); + $db = wfGetDB( DB_MASTER ); $type = $db->getType(); $prefix = $type === 'oracle' ? @@ -142,7 +144,16 @@ class ParserTestTopLevelSuite extends PHPUnit_Framework_TestSuite { $this->oldTablePrefix = $db->tablePrefix(); MediaWikiTestCase::setupTestDB( $db, $prefix ); CloneDatabase::changePrefix( $prefix ); - $teardown = $this->ptRunner->setDatabase( $db ); + + $this->ptRunner->setDatabase( $db ); + + MediaWikiTestCase::resetNonServiceCaches(); + + MediaWikiTestCase::installMockMwServices(); + $teardown = new ScopedCallback( function () { + MediaWikiTestCase::restoreMwServices(); + } ); + $teardown = $this->ptRunner->setupUploads( $teardown ); $this->ptTeardownScope = $teardown; }