Merge "Reset relevant DB tables before the first test of a suite."
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 7 Jun 2018 13:46:56 +0000 (13:46 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 7 Jun 2018 13:46:56 +0000 (13:46 +0000)
tests/phpunit/MediaWikiTestCase.php

index cf9dde0..f8dc04e 100644 (file)
@@ -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();
                        }