Replace wfGetDB in ParserTestRunner
authorGergő Tisza <tgr.huwiki@gmail.com>
Wed, 24 Jul 2019 21:52:24 +0000 (23:52 +0200)
committerGergő Tisza <tgr.huwiki@gmail.com>
Wed, 24 Jul 2019 21:54:51 +0000 (23:54 +0200)
After I0d7dacee3, wfGetDB returns a connection reference instead of
a real connection, which means it can't be passed to CloneDatabase
anymore, and testcase / test runner classes should avoid it.

Bug: T228928
Change-Id: I42be4214e33a4d4f8d53fafc925c8d708b4c0106

tests/parser/ParserTestRunner.php

index ba85027..e3c20a2 100644 (file)
@@ -1302,7 +1302,7 @@ class ParserTestRunner {
        public function setupDatabase( $nextTeardown = null ) {
                global $wgDBprefix;
 
-               $this->db = wfGetDB( DB_MASTER );
+               $this->db = MediaWikiServices::getInstance()->getDBLoadBalancer()->getConnection( DB_MASTER );
                $dbType = $this->db->getType();
 
                if ( $dbType == 'oracle' ) {