From: addshore Date: Thu, 23 Nov 2017 19:19:14 +0000 (+0000) Subject: Clarify the use of @group Database in MediaWikiTestCase X-Git-Tag: 1.31.0-rc.0~1419 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=d849eb16ffa620f85525ce09192f0c9bc3ef503c;p=lhc%2Fweb%2Fwiklou.git 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 --- 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;