When phpunit is available via the autoloader, rather than directly in the
include path, checkLess was erroring out. Additionally
RequestContext::resetMain() was outputting warnings due to MW_PHPUNIT_TEST
not being defined.
Change-Id: I28921c018daa59b2da78ffb5312690d1ce8fbb0a
*/
require_once __DIR__ . '/Maintenance.php';
-require_once 'PHPUnit/Autoload.php';
/**
* @ingroup 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",