From 89614c5623f5fe96092072885e79f8bcad6de6c8 Mon Sep 17 00:00:00 2001 From: Lucas Werkmeister Date: Mon, 27 May 2019 16:59:05 +0200 Subject: [PATCH] Clarify MediaWikiTestCase::getSchemaOverrides() I assumed that the 'create', 'drop' and 'alter' fields could be used to limit the effect of a larger schema update when a test only uses a part of it; debugging the resulting errors wasted a lot of time. Perhaps this will help to prevent others from making the same mistake. Change-Id: Iffa661ff0d967b593897667a081ee6e1399e4701 --- tests/phpunit/MediaWikiTestCase.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 486b16de85..874fc457be 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -1596,6 +1596,10 @@ abstract class MediaWikiTestCase extends PHPUnit\Framework\TestCase { * Stub. If a test suite needs to test against a specific database schema, it should * override this method and return the appropriate information from it. * + * 'create', 'drop' and 'alter' in the returned array should list all the tables affected + * by the 'scripts', even if the test is only interested in a subset of them, otherwise + * the overrides may not be fully cleaned up, leading to errors later. + * * @param IMaintainableDatabase $db The DB connection to use for the mock schema. * May be used to check the current state of the schema, to determine what * overrides are needed. -- 2.20.1