Recreate test users for every test

The assumption currently made that "we only need to add these users
once" is only because of a hack in MediaWikiTestCase that is being
removed in If251739f.

Bug: T132411
Change-Id: I4924ae941b3844b39dd3f44c6986c3bf29b0d62a
This commit is contained in:
Brad Jorsch 2016-04-12 11:42:22 -04:00
parent f2d8cac0d6
commit 406deaec3f

View file

@ -132,12 +132,9 @@ class EchoDiscussionParserTest extends MediaWikiTestCase {
$this->setMwGlobals( array( 'wgDiff' => false ) );
}
// we only need to add these users once, we won't (can't) tear them down anyway
static $executed = false;
if ( $executed === true ) {
return;
}
// users need to be added for each test, resetDB() removes them
// TODO: Only add users needed for each test, instead of adding them
// all for every one.
foreach ( $this->testUsers as $username => $preferences ) {
$user = User::createNew( $username );
@ -149,8 +146,6 @@ class EchoDiscussionParserTest extends MediaWikiTestCase {
$user->saveSettings();
}
}
$executed = true;
}
protected function tearDown() {