MediaWikiIntegrationTestCase has some code in its run() method that’s supposed to clear the tables which the test uses before the first test run, added by @daniel in I8c33be7b1b:
if ( $this->oncePerClass() ) { $this->setUpSchema( $this->db ); $this->resetDB( $this->db, $this->tablesUsed ); $this->addDBDataOnce(); }
However, if you step through this with the debugger, you can see that $this->tablesUsed is actually empty at this point. This is because it’s usually populated in setUp() – but that method is only called when MediaWikiIntegrationTestCase::run() calls parent::run(), which hasn’t happened at this point yet. (This may have been different in an earlier PHPUnit version, I don’t know.) Is there some way to fix this?