2013-07-31 05:11:18 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
2019-06-30 13:23:53 +00:00
|
|
|
* @ingroup Testing
|
2013-07-31 05:11:18 +00:00
|
|
|
*/
|
|
|
|
|
|
2017-06-06 05:05:22 +00:00
|
|
|
/**
|
2019-06-30 13:23:53 +00:00
|
|
|
* Trait that provides methods to check if group annotations are valid.
|
2017-06-06 05:05:22 +00:00
|
|
|
*/
|
2019-06-30 13:23:53 +00:00
|
|
|
trait MediaWikiGroupValidator {
|
2014-09-29 18:40:51 +00:00
|
|
|
|
2019-06-30 13:23:53 +00:00
|
|
|
/**
|
|
|
|
|
* @return bool
|
|
|
|
|
* @since 1.34
|
|
|
|
|
*/
|
2023-08-11 20:13:03 +00:00
|
|
|
private static function isTestInDatabaseGroup() {
|
2019-06-30 13:23:53 +00:00
|
|
|
// 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.
|
2023-07-18 20:22:46 +00:00
|
|
|
$rc = new ReflectionClass( static::class );
|
2023-08-11 20:13:03 +00:00
|
|
|
return (bool)preg_match( '/@group +Database\b/m', $rc->getDocComment() );
|
2014-09-29 18:40:51 +00:00
|
|
|
}
|
2013-07-31 05:11:18 +00:00
|
|
|
}
|