From: jenkins-bot Date: Thu, 15 Feb 2018 23:52:26 +0000 (+0000) Subject: Merge "tests: Commit initial version of DevelopmentSettings.php" X-Git-Tag: 1.31.0-rc.0~591 X-Git-Url: http://git.cyclocoop.org/%22%20%20.%20generer_url_ecrire%28%22mots_tous%22%29%20.%20%22?a=commitdiff_plain;h=220bda9175a18458449e9d754fb48830c1f76f25;hp=efee0800509a32b9baf1a6d3e4029e63ed9b0cd6;p=lhc%2Fweb%2Fwiklou.git Merge "tests: Commit initial version of DevelopmentSettings.php" --- diff --git a/.travis.yml b/.travis.yml index b06d9f431b..a28dac0ff0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,6 +69,8 @@ before_script: --dbuser "$dbuser" --dbpass "" --scriptpath "/w" + - echo -en "\n\nrequire_once __DIR__ . '/includes/DevelopmentSettings.php';\n" >> ./LocalSettings.php + - php -l ./LocalSettings.php script: - php tests/phpunit/phpunit.php diff --git a/includes/DevelopmentSettings.php b/includes/DevelopmentSettings.php new file mode 100644 index 0000000000..a74353ab6b --- /dev/null +++ b/includes/DevelopmentSettings.php @@ -0,0 +1,59 @@ +addOption( 'profiler', 'Profiler output format (usually "text")', false, true ); + // This is named --mwdebug, because --debug would conflict in the phpunit.php CLI script. + $this->addOption( 'mwdebug', 'Enable built-in MediaWiki development settings', false, true ); # Save generic options to display them separately in help $this->mGenericParameters = $this->mParams; @@ -1149,6 +1151,11 @@ abstract class Maintenance { MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->destroy(); } + # Apply debug settings + if ( $this->hasOption( 'mwdebug' ) ) { + require __DIR__ . '/../includes/DevelopmentSettings.php'; + } + // Per-script profiling; useful for debugging $this->activateProfiler(); diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 7203777096..a78bd82ce7 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -21,6 +21,7 @@ class PHPUnitMaintClass extends Maintenance { 'use-bagostuff' => false, 'use-jobqueue' => false, 'use-normal-tables' => false, + 'mwdebug' => false, 'reuse-db' => false, 'wiki' => false, 'profiler' => false,