From: daniel Date: Thu, 7 Jun 2018 12:36:06 +0000 (+0200) Subject: Reset relevant DB tables before the first test of a suite. X-Git-Tag: 1.34.0-rc.0~5165^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=96a964631bd7e1229567eed3467890ce23fe8819;p=lhc%2Fweb%2Fwiklou.git Reset relevant DB tables before the first test of a suite. MediaWikiTestCase truncates all the tables in the tablesUsed field after each test. It should also do that before the first test of the class. Change-Id: I8c33be7b1bdd83559a9ea7803471a1f39e0eb870 --- diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index a27e9f9cda..4c6caa3fe6 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -402,10 +402,6 @@ abstract class MediaWikiTestCase extends PHPUnit\Framework\TestCase { if ( !self::$dbSetup ) { $this->setupAllTestDBs(); $this->addCoreDBData(); - - if ( ( $this->db->getType() == 'oracle' || !self::$useTemporaryTables ) && self::$reuseDB ) { - $this->resetDB( $this->db, $this->tablesUsed ); - } } // TODO: the DB setup should be done in setUpBeforeClass(), so the test DB @@ -413,6 +409,7 @@ abstract class MediaWikiTestCase extends PHPUnit\Framework\TestCase { // This would also remove the need for the HACK that is oncePerClass(). if ( $this->oncePerClass() ) { $this->setUpSchema( $this->db ); + $this->resetDB( $this->db, $this->tablesUsed ); $this->addDBDataOnce(); }