X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcheckLess.php;h=2f533cf4b0472bea91d131c9f6fd605fcd8a02b9;hb=25bb740e50d5f4f967e80f5d6a373405e5ef187a;hp=f81285f0612fb99f29a2d12451208f1e54371f08;hpb=05000ac3f5104c62972153ebd8cdcbaaccf37b3e;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/checkLess.php b/maintenance/checkLess.php index f81285f061..2f533cf4b0 100644 --- a/maintenance/checkLess.php +++ b/maintenance/checkLess.php @@ -22,7 +22,6 @@ */ require_once __DIR__ . '/Maintenance.php'; -require_once 'PHPUnit/Autoload.php'; /** * @ingroup Maintenance @@ -31,7 +30,8 @@ class CheckLess extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = 'Checks LESS files for errors by running the LessTestSuite PHPUnit test suite'; + $this->mDescription = + 'Checks LESS files for errors by running the LessTestSuite PHPUnit test suite'; } public function execute() { @@ -42,6 +42,17 @@ class CheckLess extends Maintenance { // require it here. require_once __DIR__ . '/../tests/TestsAutoLoader.php'; + // If phpunit isn't available by autoloader try pulling it in + if ( !class_exists( 'PHPUnit_Framework_TestCase' ) ) { + require_once 'PHPUnit/Autoload.php'; + } + + // RequestContext::resetMain() will print warnings unless this + // is defined. + if ( !defined( 'MW_PHPUNIT_TEST' ) ) { + define( 'MW_PHPUNIT_TEST', true ); + } + $textUICommand = new PHPUnit_TextUI_Command(); $argv = array( "$IP/tests/phpunit/phpunit.php",