wiki.techinc.nl/tests/phpunit/MediaWikiCliOptions.php
libraryupgrader 5357695270 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
  The following sniffs now pass and were enabled:
  * Generic.ControlStructures.InlineControlStructure
  * MediaWiki.PHPUnit.AssertCount.NotUsed

npm:
* svgo: 2.3.0 → 2.3.1
  * https://npmjs.com/advisories/1754 (CVE-2021-33587)

Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
2021-07-22 03:36:05 +00:00

24 lines
854 B
PHP

<?php
/**
* @todo Get rid of this class, the options we don't need (e.g. for filebackend, bagostuff and jobqueue
* we should have dedicated test subclasses), and use getenv directly in calling code.
*/
final class MediaWikiCliOptions {
/**
* @fixme This is an awful hack.
*/
public static $additionalOptions = [
'use-filebackend' => null,
'use-bagostuff' => null,
'use-jobqueue' => null,
'use-normal-tables' => false
];
public static function initialize(): void {
self::$additionalOptions['use-normal-tables'] = (bool)getenv( 'PHPUNIT_USE_NORMAL_TABLES' );
self::$additionalOptions['use-filebackend'] = getenv( 'PHPUNIT_USE_FILEBACKEND' ) ?: null;
self::$additionalOptions['use-bagostuff'] = getenv( 'PHPUNIT_USE_BAGOSTUFF' ) ?: null;
self::$additionalOptions['use-jobqueue'] = getenv( 'PHPUNIT_USE_JOBQUEUE' ) ?: null;
}
}