If ChangeTags::updateTags() isn't passed all three of $rc_id, $rev_id,
and $log_id, it attempts to look up proper values from the subset that
is passed.
Some of the tests in ChangeTagsTest blindly use certain IDs, expecting
them to either not exist in the relevant tables or at least to be sane
(e.g. the same log_id isn't used on multiple rc_id rows). Depending on
the exact behavior of previous tests, this expectation may not hold.
The simple fix is to just mark the relevant tables as "used" by
ChangeTagsTest so MediaWikiTestCase will truncate them.
Change-Id: Ie60092b8a6e50f6f8a5cfdaaf4cac8ddb4fc6f53
$this->tablesUsed[] = 'change_tag_def';
$this->tablesUsed[] = 'tag_summary';
$this->tablesUsed[] = 'valid_tag';
+
+ // 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';
}
// TODO only modifyDisplayQuery and getSoftwareTags are tested, nothing else is