Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary

Bug: T342301
Change-Id: I5ea01f7ee103570165261bde0965c5b65e04c369
This commit is contained in:
James D. Forrester 2023-11-21 08:58:31 -05:00
parent 5c9dd5fef6
commit 4ed5ca48b1
98 changed files with 5 additions and 588 deletions

View file

@ -21,8 +21,6 @@ class CategoryTest extends MediaWikiIntegrationTestCase {
MainConfigNames::MetaNamespace => 'Project',
MainConfigNames::LanguageCode => 'en',
] );
$this->tablesUsed[] = 'category';
}
public function addDBData() {

View file

@ -11,12 +11,6 @@ use Wikimedia\Rdbms\IMaintainableDatabase;
*/
class CommentStoreTest extends MediaWikiLangTestCase {
protected $tablesUsed = [
'revision',
'ipblocks',
'comment',
];
protected function getSchemaOverrides( IMaintainableDatabase $db ) {
return [
'scripts' => [

View file

@ -24,8 +24,6 @@ class TagsDefTest extends MediaWikiIntegrationTestCase {
ChangeTags::defineTag( 'tag1' );
ChangeTags::defineTag( 'tag2' );
$this->tablesUsed[] = 'change_tag_def';
// Since the type def shouldn't care about the specific user,
// remove the right from relevant groups to ensure that it's not
// checking.

View file

@ -48,25 +48,6 @@ class ArchivedRevisionLookupTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[
'page',
'revision',
'ip_changes',
'text',
'archive',
'recentchanges',
'logging',
'page_props',
'comment',
'slots',
'content',
'content_models',
'slot_roles',
]
);
$timestamp = 1635000000;
MWTimestamp::setFakeTime( $timestamp );

View file

@ -66,20 +66,6 @@ class RevisionStoreDbTest extends MediaWikiIntegrationTestCase {
*/
private $testPage;
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'archive';
$this->tablesUsed[] = 'page';
$this->tablesUsed[] = 'revision';
$this->tablesUsed[] = 'comment';
$this->tablesUsed[] = 'actor';
$this->tablesUsed[] = 'recentchanges';
$this->tablesUsed[] = 'content';
$this->tablesUsed[] = 'slots';
$this->tablesUsed[] = 'content_models';
$this->tablesUsed[] = 'slot_roles';
}
/**
* @return Title
*/

View file

@ -51,12 +51,6 @@ use WikitextContentHandler;
class DerivedPageDataUpdaterTest extends MediaWikiIntegrationTestCase {
use MockTitleTrait;
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'page';
}
/**
* @param string $title
*

View file

@ -25,11 +25,6 @@ use Wikimedia\TestingAccessWrapper;
*/
class NameTableStoreTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'slot_roles';
}
private function populateTable( $values ) {
$insertValues = [];
foreach ( $values as $name ) {

View file

@ -51,10 +51,6 @@ class PageUpdaterTest extends MediaWikiIntegrationTestCase {
true
);
}
$this->tablesUsed[] = 'logging';
$this->tablesUsed[] = 'recentchanges';
$this->tablesUsed[] = 'change_tag';
}
private function getDummyTitle( $method ) {

View file

@ -26,10 +26,6 @@ class ApiBlockTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'ipblocks', 'ipblocks_restrictions', 'change_tag', 'change_tag_def', 'logging' ]
);
$this->mUser = $this->getMutableTestUser()->getUser();
$this->overrideConfigValue(

View file

@ -21,11 +21,6 @@ class ApiChangeContentModelTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'change_tag', 'change_tag_def', 'logging' ]
);
$this->getExistingTestPage( 'ExistingPage' );
$this->overrideConfigValues( [

View file

@ -19,10 +19,6 @@ class ApiDeleteTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'change_tag', 'change_tag_def', 'logging', 'watchlist', 'watchlist_expiry' ]
);
$this->overrideConfigValue( MainConfigNames::WatchlistExpiry, true );
}

View file

@ -44,10 +44,6 @@ class ApiEditPageTest extends ApiTestCase {
'testing-nontext' => 'DummyNonTextContentHandler',
'testing-serialize-error' => 'DummySerializeErrorContentHandler',
] );
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'change_tag', 'change_tag_def', 'logging', 'watchlist', 'watchlist_expiry' ]
);
}
public function testEdit() {

View file

@ -15,11 +15,6 @@ use Wikimedia\TestingAccessWrapper;
* @covers ApiLogin
*/
class ApiLoginTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'bot_passwords';
}
public static function provideEnableBotPasswords() {
return [

View file

@ -18,11 +18,6 @@ class ApiMoveTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'watchlist', 'watchlist_expiry' ]
);
$this->overrideConfigValue( MainConfigNames::WatchlistExpiry, true );
}

View file

@ -152,7 +152,6 @@ class ApiParseTest extends ApiTestCase {
MainConfigNames::ExtraInterlanguageLinkPrefixes,
[ 'madeuplanguage' ]
);
$this->tablesUsed[] = 'interwiki';
}
/**

View file

@ -16,10 +16,6 @@ class ApiProtectTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'page_restrictions', 'logging', 'watchlist', 'watchlist_expiry' ]
);
$this->overrideConfigValue( MainConfigNames::WatchlistExpiry, true );
}

View file

@ -17,11 +17,6 @@ class ApiRollbackTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'watchlist', 'watchlist_expiry' ]
);
$this->overrideConfigValue( MainConfigNames::WatchlistExpiry, true );
}

View file

@ -9,15 +9,6 @@
*/
class ApiSetNotificationTimestampIntegrationTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'page', 'watchlist', 'watchlist_expiry' ]
);
}
public function testStuff() {
$user = $this->getTestUser()->getUser();
$watchedPageTitle = 'PageWatched';

View file

@ -20,11 +20,6 @@ class ApiUnblockTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'ipblocks', 'change_tag', 'change_tag_def', 'logging' ]
);
$this->blocker = $this->getTestSysop()->getUser();
$this->blockee = $this->getMutableTestUser()->getUser();

View file

@ -16,10 +16,6 @@ class ApiUndeleteTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'logging', 'watchlist', 'watchlist_expiry' ]
);
$this->overrideConfigValue( MainConfigNames::WatchlistExpiry, true );
}

View file

@ -21,9 +21,7 @@ class ApiUploadTest extends ApiUploadTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'watchlist'; // This test might interfere with watchlists test.
$this->tablesUsed[] = 'watchlist_expiry';
$this->tablesUsed = array_merge( $this->tablesUsed, LocalFile::getQueryInfo()['tables'] );
$this->setService( 'RepoGroup', new RepoGroup(
[
'class' => LocalRepo::class,

View file

@ -16,10 +16,7 @@ class ApiUserrightsTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'change_tag', 'change_tag_def', 'logging' ]
);
$this->overrideConfigValues( [
MainConfigNames::AddGroups => [],
MainConfigNames::RemoveGroups => [],

View file

@ -14,11 +14,6 @@ class ApiWatchTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'page', 'watchlist', 'watchlist_expiry' ]
);
// Fake current time to be 2019-06-05T19:50:42Z
ConvertibleTimestamp::setFakeTime( 1559764242 );

View file

@ -8,11 +8,6 @@
*/
class ApiQueryAllRevisionsTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'revision';
}
/**
* @group medium
*/

View file

@ -16,11 +16,6 @@ use MediaWiki\MainConfigNames;
*/
class ApiQueryBlocksTest extends ApiTestCase {
protected $tablesUsed = [
'ipblocks',
'ipblocks_restrictions',
];
public function testExecute() {
[ $data ] = $this->doApiRequest( [
'action' => 'query',

View file

@ -27,12 +27,6 @@ class ApiQueryImageInfoTest extends ApiTestCase {
private $testUser = null;
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'image';
$this->tablesUsed[] = 'oldimage';
}
public function addDBData() {
parent::addDBData();
$this->testUser = new UserIdentityValue( 12364321, 'Dummy User' );

View file

@ -18,11 +18,6 @@ class ApiQueryInfoTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'watchlist', 'watchlist_expiry' ]
);
$this->overrideConfigValues( [
MainConfigNames::WatchlistExpiry => true,
MainConfigNames::WatchlistExpiryMaxDuration => '6 months',

View file

@ -14,11 +14,6 @@ use MediaWiki\User\User;
*/
class ApiQueryRecentChangesIntegrationTest extends ApiTestCase {
protected $tablesUsed = [
'recentchanges',
'page',
];
private function getLoggedInTestUser() {
return $this->getTestUser()->getUser();
}

View file

@ -204,7 +204,6 @@ class ApiQuerySiteinfoTest extends ApiTestCase {
__METHOD__,
'IGNORE'
);
$this->tablesUsed[] = 'interwiki';
$this->getServiceContainer()->getMessageCache()->enable();

View file

@ -20,9 +20,6 @@ class ApiQueryWatchlistIntegrationTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_unique(
array_merge( $this->tablesUsed, [ 'watchlist', 'recentchanges', 'page' ] )
);
$this->loggedInUser = $this->getMutableTestUser()->getUser();
$this->notLoggedInUser = $this->getMutableTestUser()->getUser();

View file

@ -18,11 +18,6 @@ class ApiQueryWatchlistRawIntegrationTest extends ApiTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'watchlist', 'watchlist_expiry' ]
);
$this->loggedInUser = $this->getMutableTestUser()->getUser();
$this->notLoggedInUser = $this->getMutableTestUser()->getUser();
}

View file

@ -105,12 +105,6 @@ class AuthManagerTest extends \MediaWikiIntegrationTestCase {
/** @var UserOptionsManager */
private $userOptionsManager;
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'ipblocks';
$this->tablesUsed[] = 'user';
}
/**
* Sets a mock on a hook
* @param string $hook

View file

@ -927,7 +927,6 @@ class BlockManagerTest extends MediaWikiIntegrationTestCase {
}
public function testGetBlocksForIPList() {
$this->tablesUsed[] = 'ipblocks';
$blockManager = $this->getBlockManager( [] );
$block = new DatabaseBlock( [
'address' => '1.2.3.4',

View file

@ -10,21 +10,6 @@ use Wikimedia\Rdbms\Platform\ISQLPlatform;
*/
class ChangeTagsTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'change_tag';
$this->tablesUsed[] = 'change_tag_def';
// Truncate these to avoid the supposed-to-be-unused IDs in tests here turning
// out to be used, leading ChangeTags::updateTags() to pick up bogus rc_id,
// log_id, or rev_id values and run into unique constraint violations.
$this->tablesUsed[] = 'recentchanges';
$this->tablesUsed[] = 'logging';
$this->tablesUsed[] = 'revision';
$this->tablesUsed[] = 'archive';
}
protected function tearDown(): void {
parent::tearDown();
}

View file

@ -24,11 +24,6 @@ class ContentModelChangeTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'change_tag', 'change_tag_def', 'logging' ]
);
$this->getExistingTestPage( 'ExistingPage' );
$this->mergeMwGlobalArrayValue( 'wgContentHandlers', [
'testing' => 'DummyContentHandlerForTesting',

View file

@ -15,10 +15,6 @@ class TextContentTest extends MediaWikiLangTestCase {
protected function setUp(): void {
parent::setUp();
// trigger purging of all page related tables
$this->tablesUsed[] = 'page';
$this->tablesUsed[] = 'revision';
// Anon user
$user = new User();
$user->setName( '127.0.0.1' );

View file

@ -26,21 +26,6 @@ use MediaWiki\Title\TitleValue;
*/
class LinksDeletionUpdateTest extends MediaWikiLangTestCase {
public function testUpdate() {
$this->tablesUsed = array_merge( $this->tablesUsed,
[
'interwiki',
'page_props',
'pagelinks',
'categorylinks',
'langlinks',
'externallinks',
'imagelinks',
'templatelinks',
'iwlinks',
'recentchanges',
]
);
$res = $this->insertPage( 'Source' );
$id = $res['id'];
$title = $res['title'];

View file

@ -35,22 +35,6 @@ class LinksUpdateTest extends MediaWikiLangTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge( $this->tablesUsed,
[
'interwiki',
'page_props',
'pagelinks',
'categorylinks',
'category',
'langlinks',
'externallinks',
'imagelinks',
'templatelinks',
'iwlinks',
'recentchanges',
]
);
$this->getDb()->newReplaceQueryBuilder()
->replaceInto( 'interwiki' )
->uniqueIndexFields( [ 'iw_prefix' ] )

View file

@ -20,14 +20,6 @@ use Wikimedia\TestingAccessWrapper;
class LocalFileTest extends MediaWikiIntegrationTestCase {
use MockAuthorityTrait;
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'image';
$this->tablesUsed[] = 'oldimage';
$this->tablesUsed[] = 'page';
$this->tablesUsed[] = 'text';
}
private static function getDefaultInfo() {
return [
'name' => 'test',

View file

@ -13,9 +13,6 @@ class ImportableOldRevisionImporterTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'change_tag';
$this->tablesUsed[] = 'change_tag_def';
ChangeTags::defineTag( 'tag1' );
}

View file

@ -14,7 +14,6 @@ class ClassicInterwikiLookupTest extends MediaWikiIntegrationTestCase {
private function populateDB( $iwrows ) {
$this->db->delete( 'interwiki', '*', __METHOD__ );
$this->db->insert( 'interwiki', array_values( $iwrows ), __METHOD__ );
$this->tablesUsed[] = 'interwiki';
}
/**

View file

@ -49,7 +49,6 @@ class InterwikiTest extends MediaWikiIntegrationTestCase {
->where( ISQLPlatform::ALL_ROWS )
->caller( __METHOD__ )->execute();
$dbw->insert( 'interwiki', array_values( $iwrows ), __METHOD__ );
$this->tablesUsed[] = 'interwiki';
}
private function setWgInterwikiCache( $interwikiCache ) {

View file

@ -17,8 +17,6 @@ class JobQueueTest extends MediaWikiIntegrationTestCase {
global $wgJobTypeConf;
parent::setUp();
$this->tablesUsed[] = 'job';
$services = $this->getServiceContainer();
if ( $this->getCliArg( 'use-jobqueue' ) ) {
$name = $this->getCliArg( 'use-jobqueue' );

View file

@ -7,14 +7,6 @@
*/
class RefreshLinksPartitionTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'page';
$this->tablesUsed[] = 'revision';
$this->tablesUsed[] = 'pagelinks';
}
/**
* @dataProvider provideBacklinks
* @covers BacklinkJobUtils

View file

@ -14,16 +14,6 @@ use MediaWiki\Title\Title;
*/
class RefreshLinksJobTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'page';
$this->tablesUsed[] = 'revision';
$this->tablesUsed[] = 'pagelinks';
$this->tablesUsed[] = 'categorylinks';
}
/**
* @param string $name
* @param Content[] $content

View file

@ -7,10 +7,6 @@ use MediaWiki\Title\TitleValue;
* @covers MediaWiki\Linker\LinkTargetStore
*/
class LinkTargetStoreTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'linktarget';
}
public static function provideLinkTargets() {
yield [ new TitleValue( NS_SPECIAL, 'BlankPage' ) ];

View file

@ -14,11 +14,6 @@ class EmailNotificationTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = [
'watchlist',
'watchlist_expiry',
];
$this->emailNotification = new EmailNotification();
$this->overrideConfigValue( MainConfigNames::WatchlistExpiry, true );

View file

@ -13,11 +13,6 @@ use MediaWiki\User\User;
*/
class ArticleTest extends \MediaWikiIntegrationTestCase {
protected $tablesUsed = [
'revision',
'recentchanges',
];
/**
* @param Title $title
* @param User|null $user

View file

@ -104,10 +104,6 @@ class MovePageTest extends MediaWikiIntegrationTestCase {
}
}
);
$this->tablesUsed[] = 'page';
$this->tablesUsed[] = 'revision';
$this->tablesUsed[] = 'comment';
}
/**

View file

@ -45,25 +45,6 @@ class PageArchiveTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[
'page',
'revision',
'ip_changes',
'text',
'archive',
'recentchanges',
'logging',
'page_props',
'comment',
'slots',
'content',
'content_models',
'slot_roles',
]
);
// First create our dummy page
$this->archivedPage = Title::makeTitle( NS_MAIN, 'PageArchiveTest_thePage' );
$page = $this->getServiceContainer()->getWikiPageFactory()->newFromTitle( $this->archivedPage );

View file

@ -27,11 +27,6 @@ class PageStoreTest extends MediaWikiIntegrationTestCase {
use MockTitleTrait;
use LinkCacheTestTrait;
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'page';
}
/**
* @param array $options
* @param array $params

View file

@ -25,25 +25,6 @@ class UndeletePageTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[
'page',
'revision',
'ip_changes',
'text',
'archive',
'recentchanges',
'logging',
'page_props',
'comment',
'slots',
'content',
'content_models',
'slot_roles',
]
);
$this->ipEditor = '2001:DB8:0:0:0:0:0:1';
$this->setupPage( 'UndeletePageTest_thePage', NS_MAIN, ' ' );
$this->setupPage( 'UndeletePageTest_thePage', NS_TALK, ' ' );

View file

@ -25,41 +25,6 @@ class WikiPageDbTest extends MediaWikiLangTestCase {
use DummyServicesTrait;
use MockAuthorityTrait;
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[
'page',
'revision',
'redirect',
'archive',
'category',
'ip_changes',
'text',
'slots',
'content',
'slot_roles',
'content_models',
'recentchanges',
'logging',
'page_props',
'page_restrictions',
'pagelinks',
'categorylinks',
'langlinks',
'externallinks',
'imagelinks',
'templatelinks',
'iwlinks'
]
);
}
protected function tearDown(): void {
ParserOptions::clearStaticCache();
parent::tearDown();

View file

@ -29,8 +29,6 @@ use MediaWiki\User\User;
*/
class UserPasswordPolicyTest extends MediaWikiIntegrationTestCase {
protected $tablesUsed = [ 'user', 'user_groups' ];
protected $policies = [
'checkuser' => [
'MinimalPasswordLength' => [ 'value' => 10, 'forceChange' => true ],

View file

@ -13,7 +13,6 @@ use Psr\Log\NullLogger;
* @group Database
*/
class PoolWorkArticleViewTest extends MediaWikiIntegrationTestCase {
protected $tablesUsed = [ 'page' ];
/**
* @param LoggerInterface|null $logger

View file

@ -398,7 +398,6 @@ class ContribsPagerTest extends MediaWikiIntegrationTestCase {
* @covers \ContribsPager::doBatchLookups
*/
public function testPopulatedIntegration() {
$this->tablesUsed[] = 'page';
$user = $this->getTestUser()->getUser();
$title = Title::makeTitle( NS_MAIN, 'ContribsPagerTest' );
$this->editPage( $title, '', '', NS_MAIN, $user );

View file

@ -179,8 +179,6 @@ class SpecialRecentChangesTest extends AbstractChangesListSpecialPageTestCase {
* check for syntax errors etc. It doesn't verify the logic.
*/
public function testIsDenseTagFilter() {
$this->tablesUsed[] = 'change_tag_def';
$this->tablesUsed[] = 'change_tag';
ChangeTags::defineTag( 'rc-test-tag' );
$req = new FauxRequest();
$req->setVal( 'tagfilter', 'rc-test-tag' );
@ -208,8 +206,6 @@ class SpecialRecentChangesTest extends AbstractChangesListSpecialPageTestCase {
* @dataProvider provideDenseTagFilter
*/
public function testDenseTagFilter( $dense ) {
$this->tablesUsed[] = 'change_tag_def';
$this->tablesUsed[] = 'change_tag';
ChangeTags::defineTag( 'rc-test-tag' );
$req = new FauxRequest();
$req->setVal( 'tagfilter', 'rc-test-tag' );

View file

@ -12,8 +12,6 @@ use MediaWiki\Specials\SpecialRedirect;
*/
class SpecialRedirectTest extends MediaWikiIntegrationTestCase {
protected $tablesUsed = [ 'user' ];
private const CREATE_USER = 'create_user';
/**

View file

@ -9,7 +9,6 @@ use MediaWiki\Specials\SpecialUserRights;
* @covers \MediaWiki\Specials\SpecialUserRights
*/
class SpecialUserRightsTest extends SpecialPageTestBase {
protected $tablesUsed = [ 'user', 'logging' ];
/**
* @inheritDoc

View file

@ -16,7 +16,7 @@ use Wikimedia\TestingAccessWrapper;
class SpecialWatchlistTest extends SpecialPageTestBase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = [ 'watchlist' ];
$this->setTemporaryHook(
'ChangesListSpecialPageQuery',
HookContainer::NOOP

View file

@ -238,12 +238,6 @@ class BlockListPagerTest extends MediaWikiIntegrationTestCase {
* @covers ::preprocessResults
*/
public function testPreprocessResults() {
$this->tablesUsed[] = 'ipblocks';
$this->tablesUsed[] = 'ipblocks_restrictions';
$this->tablesUsed[] = 'comment';
$this->tablesUsed[] = 'page';
$this->tablesUsed[] = 'user';
// Test the Link Cache.
$linkCache = $this->getServiceContainer()->getLinkCache();
$wrappedlinkCache = TestingAccessWrapper::newFromObject( $linkCache );

View file

@ -18,10 +18,6 @@ class ActorMigrationTest extends MediaWikiLangTestCase {
protected static $amId = 0;
protected $tablesUsed = [
'actor',
];
private const STAGES_BY_NAME = [
'old' => SCHEMA_COMPAT_WRITE_OLD | SCHEMA_COMPAT_READ_OLD,
'read-old' => SCHEMA_COMPAT_WRITE_OLD_AND_TEMP | SCHEMA_COMPAT_READ_OLD,

View file

@ -25,7 +25,6 @@ class TalkPageNotificationManagerTest extends MediaWikiIntegrationTestCase {
parent::setUp();
// tablesUsed don't clear up the database before the first test runs: T265033
$this->truncateTable( 'user_newtalk' );
$this->tablesUsed[] = 'user_newtalk';
}
private function editUserTalk( UserIdentity $user, string $text ): RevisionRecord {

View file

@ -12,8 +12,6 @@ use MediaWiki\User\UserRigorOptions;
* @group Database
*/
class UserEditTrackerTest extends MediaWikiIntegrationTestCase {
/** @inheritDoc */
protected $tablesUsed = [ 'page' ];
/**
* Do an edit

View file

@ -114,10 +114,7 @@ class UserGroupManagerTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'user';
$this->tablesUsed[] = 'user_groups';
$this->tablesUsed[] = 'user_former_groups';
$this->tablesUsed[] = 'logging';
$this->expiryTime = wfTimestamp( TS_MW, time() + 100500 );
$this->clearHooks();
}

View file

@ -22,12 +22,6 @@ use Wikimedia\Timestamp\ConvertibleTimestamp;
*/
class UserOptionsManagerTest extends UserOptionsLookupTest {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'user';
$this->tablesUsed[] = 'user_properties';
}
/**
* @param array $overrides supported keys:
* - 'language' - string language code

View file

@ -48,8 +48,6 @@ class UserTest extends MediaWikiIntegrationTestCase {
$this->setUpPermissionGlobals();
$this->user = $this->getTestUser( 'unittesters' )->getUser();
$this->tablesUsed[] = 'user';
$this->tablesUsed[] = 'revision';
}
private function setUpPermissionGlobals() {
@ -1017,8 +1015,6 @@ class UserTest extends MediaWikiIntegrationTestCase {
* @covers User::getBlock
*/
public function testCompositeBlocks() {
$this->tablesUsed[] = 'ipblocks';
$user = $this->getMutableTestUser()->getUser();
$request = $user->getRequest();
$this->setSessionUser( $user, $request );
@ -1049,8 +1045,6 @@ class UserTest extends MediaWikiIntegrationTestCase {
* @covers User::getBlock
*/
public function testUserBlock() {
$this->tablesUsed[] = 'ipblocks';
$user = $this->getMutableTestUser()->getUser();
$request = $user->getRequest();
$this->setSessionUser( $user, $request );

View file

@ -15,9 +15,6 @@ class WatchedItemQueryServiceIntegrationTest extends MediaWikiIntegrationTestCas
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'watchlist';
$this->tablesUsed[] = 'watchlist_expiry';
$this->overrideConfigValue( MainConfigNames::WatchlistExpiry, true );
}

View file

@ -384,7 +384,6 @@ class CommentParserTest extends \MediaWikiIntegrationTestCase {
}
public function testLinkCacheInteraction() {
$this->tablesUsed[] = 'page';
$services = $this->getServiceContainer();
$present = $this->getExistingTestPage( 'Present' )->getTitle();
$absent = $this->getNonexistingTestPage( 'Absent' )->getTitle();

View file

@ -49,15 +49,6 @@ class HtmlInputTransformHelperTest extends MediaWikiIntegrationTestCase {
parent::setUp();
$this->overrideConfigValue( MainConfigNames::CacheEpoch, self::CACHE_EPOCH );
// Clean up these tables after each test
$this->tablesUsed = [
'page',
'revision',
'comment',
'text',
'content'
];
}
/**

View file

@ -216,15 +216,6 @@ class HtmlOutputRendererHelperTest extends MediaWikiIntegrationTestCase {
parent::setUp();
$this->overrideConfigValue( MainConfigNames::CacheEpoch, self::CACHE_EPOCH );
// Clean up these tables after each test
$this->tablesUsed = [
'page',
'revision',
'comment',
'text',
'content'
];
}
/**

View file

@ -27,15 +27,6 @@ class PageContentHelperTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
// Clean up these tables after each test
$this->tablesUsed = [
'page',
'revision',
'comment',
'text',
'content'
];
}
/**

View file

@ -24,19 +24,6 @@ class RevisionContentHelperTest extends MediaWikiIntegrationTestCase {
private const NO_REVISION_ETAG = '"b620cd7841f9ea8f545f11cc44ce794f848fa2d3"';
protected function setUp(): void {
parent::setUp();
// Clean up these tables after each test
$this->tablesUsed = [
'page',
'revision',
'comment',
'text',
'content'
];
}
/**
* @param array $params
* @param Authority|null $authority

View file

@ -42,15 +42,6 @@ class PageHTMLHandlerTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
// Clean up these tables after each test
$this->tablesUsed = [
'page',
'revision',
'comment',
'text',
'content'
];
$this->parserCacheBagOStuff = new HashBagOStuff();
}

View file

@ -29,15 +29,6 @@ class PageRedirectHandlerTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
// Clean up these tables after each test
$this->tablesUsed = [
'page',
'revision',
'comment',
'text',
'content'
];
$this->parserCacheBagOStuff = new HashBagOStuff();
}

View file

@ -28,15 +28,6 @@ class PageSourceHandlerTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
// Clean up these tables after each test
$this->tablesUsed = [
'page',
'revision',
'comment',
'text',
'content'
];
$this->overrideConfigValues( [
MainConfigNames::RightsUrl => 'https://example.com/rights',
MainConfigNames::RightsText => 'some rights',

View file

@ -54,8 +54,6 @@ use WikitextContent;
class ParsoidHandlerTest extends MediaWikiIntegrationTestCase {
use RestTestTrait;
protected $tablesUsed = [ 'page' ];
/**
* Default request attributes, see ParsoidHandler::getRequestAttributes()
*/

View file

@ -48,15 +48,6 @@ class RevisionHTMLHandlerTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
// Clean up these tables after each test
$this->tablesUsed = [
'page',
'revision',
'comment',
'text',
'content'
];
$this->parserCacheBagOStuff = new HashBagOStuff();
}

View file

@ -27,15 +27,6 @@ class RevisionSourceHandlerTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
// Clean up these tables after each test
$this->tablesUsed = [
'page',
'revision',
'comment',
'text',
'content'
];
$this->overrideConfigValues( [
'RightsUrl' => 'https://example.com/rights',
'RightsText' => 'some rights',

View file

@ -91,14 +91,6 @@ class EditResultBuilderDbTest extends MediaWikiIntegrationTestCase {
self::CONTENT_B,
'20050101210041'
);
$this->tablesUsed = [
'page',
'revision',
'comment',
'text',
'content'
];
}
private function getLatestTestRevision(): RevisionRecord {

View file

@ -21,23 +21,6 @@ use WikiPage;
* @see RevertedTagUpdateTest for non-DB tests
*/
class RevertedTagUpdateIntegrationTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[
'page',
'revision',
'comment',
'text',
'content',
'change_tag',
'objectcache',
'job'
]
);
}
/**
* This test ensures the update is not performed at the end of the web request, but

View file

@ -32,19 +32,6 @@ class UndoIntegrationTest extends MediaWikiIntegrationTestCase {
private const PAGE_NAME = 'McrUndoTestPage';
protected function setUp(): void {
parent::setUp();
// Clean up these tables after each test
$this->tablesUsed = [
'page',
'revision',
'comment',
'text',
'content'
];
}
/**
* Creates a new McrUndoAction object for testing.
*

View file

@ -28,8 +28,6 @@ class BlockUserTest extends MediaWikiIntegrationTestCase {
// Prepare factory
$this->blockUserFactory = $this->getServiceContainer()->getBlockUserFactory();
$this->tablesUsed[] = 'ipblocks';
}
/**

View file

@ -711,9 +711,6 @@ class DatabaseBlockStoreTest extends MediaWikiIntegrationTestCase {
foreach ( $restrictionData as $row ) {
$this->db->insert( 'ipblocks_restrictions', $row );
}
$this->tablesUsed[] = 'ipblocks';
$this->tablesUsed[] = 'ipblocks_restrictions';
}
}

View file

@ -36,10 +36,6 @@ class ChangeTagsConstraintTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = array_merge(
$this->tablesUsed,
[ 'change_tag', 'change_tag_def', 'logging' ]
);
}
public function testPass() {

View file

@ -31,10 +31,6 @@ use Wikimedia\Rdbms\IMaintainableDatabase;
* @covers \Wikimedia\Rdbms\SqliteResultWrapper
*/
class ResultWrapperTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
$this->tablesUsed[] = 'ResultWrapperTest';
}
public function getSchemaOverrides( IMaintainableDatabase $db ) {
return [
'create' => [ 'ResultWrapperTest' ],

View file

@ -30,7 +30,6 @@ class LogPageTest extends \MediaWikiIntegrationTestCase {
'test_test' => 'testing-log-restriction'
]
] );
$this->tablesUsed[] = 'logging';
}
/**

View file

@ -26,22 +26,6 @@ use WikiPage;
* @note Permission-related tests are in \MediaWiki\Tests\Unit\Page\DeletePageTest
*/
class DeletePageTest extends MediaWikiIntegrationTestCase {
protected $tablesUsed = [
'page',
'revision',
'redirect',
'archive',
'text',
'slots',
'content',
'slot_roles',
'content_models',
'recentchanges',
'logging',
'pagelinks',
'change_tag',
'change_tag_def',
];
private const PAGE_TEXT = "[[Stuart Little]]\n" .
"{{Multiple issues}}\n" .

View file

@ -36,12 +36,8 @@ class RollbackPageTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->overrideConfigValue( MainConfigNames::UseRCPatrol, true );
$this->tablesUsed = array_merge( $this->tablesUsed, [
'page',
'recentchanges',
'logging',
] );
}
public function provideAuthorize() {

View file

@ -14,16 +14,6 @@ use MediaWiki\Page\PageIdentityValue;
*/
class RevisionListTest extends MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'revision';
$this->tablesUsed[] = 'page';
$this->tablesUsed[] = 'comment';
$this->tablesUsed[] = 'content';
$this->tablesUsed[] = 'user';
}
public function testGetType() {
$context = new RequestContext();
$page = new PageIdentityValue( 123, NS_MAIN, __METHOD__, PageIdentity::LOCAL );

View file

@ -17,8 +17,6 @@ abstract class ActorStoreTestBase extends MediaWikiIntegrationTestCase {
protected const IP = '2600:1004:B14A:5DDD:3EBE:BBA4:BFBA:F37E';
public function addDBData() {
$this->tablesUsed[] = 'actor';
$actors = [
'registered' => [ 'actor_id' => '42', 'actor_user' => '24', 'actor_name' => 'TestUser' ],
'anon' => [ 'actor_id' => '43', 'actor_user' => null, 'actor_name' => self::IP ],

View file

@ -33,9 +33,6 @@ class TempUserCreatorTest extends \MediaWikiIntegrationTestCase {
];
public function testCreate() {
$this->tablesUsed[] = 'user';
$this->tablesUsed[] = 'user_autocreate_serial';
$this->overrideConfigValue(
MainConfigNames::AutoCreateTempUser,
[
@ -114,7 +111,6 @@ class TempUserCreatorTest extends \MediaWikiIntegrationTestCase {
}
public function testAcquireName_db() {
$this->tablesUsed[] = 'user_autocreate_serial';
$this->overrideConfigValue(
MainConfigNames::AutoCreateTempUser,
[ 'enabled' => true ] + self::DEFAULTS

View file

@ -13,11 +13,6 @@ use MediaWiki\User\UserIdentityValue;
class WatchlistManagerTest extends MediaWikiIntegrationTestCase {
use MockAuthorityTrait;
protected function setUp(): void {
parent::setUp();
$this->tablesUsed[] = 'watchlist';
}
/**
* While this *could* be moved to a unit test, it is specifically kept
* here as an integration test to double check that the actual integration

View file

@ -59,9 +59,6 @@ class BackupDumperLoggerTest extends DumpTestCase {
}
public function addDBData() {
$this->tablesUsed[] = 'logging';
$this->tablesUsed[] = 'user';
try {
$user1 = User::newFromName( 'BackupDumperLogUserA' );
$this->userId1 = $user1->getId();

View file

@ -16,7 +16,6 @@ class DeleteAutoPatrolLogsTest extends MaintenanceBaseTestCase {
protected function setUp(): void {
parent::setUp();
$this->tablesUsed = [ 'logging' ];
$this->cleanLoggingTable();
$this->insertLoggingData();

View file

@ -51,11 +51,6 @@ trait PageDumpTestDataTrait {
// be sure, titles created here using english namespace names
$this->setContentLang( 'en' );
$this->tablesUsed[] = 'page';
$this->tablesUsed[] = 'revision';
$this->tablesUsed[] = 'ip_changes';
$this->tablesUsed[] = 'text';
try {
$this->namespace = $this->getDefaultWikitextNS();
$this->talk_namespace = NS_TALK;

View file

@ -29,7 +29,6 @@ use Wikimedia\TestingAccessWrapper;
* @coversNothing
*/
class ContentHandlerFunctionalTest extends MediaWikiIntegrationTestCase {
protected $tablesUsed = [ 'page' ];
public function testMakeEmptyContent() {
$contentHandlerFactory = MediaWikiServices::getInstance()->getContentHandlerFactory();

View file

@ -397,7 +397,6 @@ class MediaWikiIntegrationTestCaseTest extends MediaWikiIntegrationTestCase {
// Avoid self-deadlocks with Sqlite
$this->markTestSkippedIfDbType( 'sqlite' );
$this->tablesUsed[] = 'objectcache';
$this->db->insert(
'objectcache',
[ 'keyname' => __METHOD__, 'value' => 'TEST', 'exptime' => $this->db->timestamp( 11 ) ],