From d849eb16ffa620f85525ce09192f0c9bc3ef503c Mon Sep 17 00:00:00 2001 From: addshore Date: Thu, 23 Nov 2017 19:19:14 +0000 Subject: [PATCH] Clarify the use of @group Database in MediaWikiTestCase Only the class level doc comment is checked. Adding @group Database to a method doc comment will do nothing. Change-Id: Ic0fff3636d6c44e7a27df8806c9712155ce81d8c --- tests/phpunit/MediaWikiTestCase.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index f04eec73b4..4d3c37bda5 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -968,12 +968,13 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * @since 1.18 */ public function needsDB() { - # if the test says it uses database tables, it needs the database + // If the test says it uses database tables, it needs the database if ( $this->tablesUsed ) { return true; } - # if the test says it belongs to the Database group, it needs the database + // If the test class says it belongs to the Database group, it needs the database. + // NOTE: This ONLY checks for the group in the class level doc comment. $rc = new ReflectionClass( $this ); if ( preg_match( '/@group +Database/im', $rc->getDocComment() ) ) { return true; -- 2.20.1