From 86ae560f62ee9a4e809a8f77a084bad47e1db17b Mon Sep 17 00:00:00 2001 From: Jakob Warkotsch Date: Mon, 16 Jul 2018 14:52:20 +0200 Subject: [PATCH] Fix test database prefix in ParserTestTopLevelSuite Similar to I3c3553f2ec6b5ca0d401712e4018c7eec4d9204d Bug: T198943 Change-Id: I432ecfed48285978eddcbadad68108cfddf91499 --- tests/phpunit/suites/ParserTestTopLevelSuite.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/phpunit/suites/ParserTestTopLevelSuite.php b/tests/phpunit/suites/ParserTestTopLevelSuite.php index fe38a981cd..1ea5853f9d 100644 --- a/tests/phpunit/suites/ParserTestTopLevelSuite.php +++ b/tests/phpunit/suites/ParserTestTopLevelSuite.php @@ -17,6 +17,8 @@ class ParserTestTopLevelSuite extends PHPUnit_Framework_TestSuite { /** @var ScopedCallback */ private $ptTeardownScope; + private $oldTablePrefix = ''; + /** * @defgroup filtering_constants Filtering constants * @@ -137,7 +139,9 @@ class ParserTestTopLevelSuite extends PHPUnit_Framework_TestSuite { $type = $db->getType(); $prefix = $type === 'oracle' ? MediaWikiTestCase::ORA_DB_PREFIX : MediaWikiTestCase::DB_PREFIX; + $this->oldTablePrefix = $db->tablePrefix(); MediaWikiTestCase::setupTestDB( $db, $prefix ); + CloneDatabase::changePrefix( $prefix ); $teardown = $this->ptRunner->setDatabase( $db ); $teardown = $this->ptRunner->setupUploads( $teardown ); $this->ptTeardownScope = $teardown; @@ -148,6 +152,7 @@ class ParserTestTopLevelSuite extends PHPUnit_Framework_TestSuite { if ( $this->ptTeardownScope ) { ScopedCallback::consume( $this->ptTeardownScope ); } + CloneDatabase::changePrefix( $this->oldTablePrefix ); } /** -- 2.20.1