From 54f1423ecc1f5372ca452ab14aeab16489ce1e6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0koda?= Date: Sat, 8 Mar 2014 14:34:15 +0800 Subject: [PATCH] MDL-44510 support PHPUnit 4.x The old style PEAR installation is incompatible with PHPUnit 4, nobody was supposed to use PEAR any more - composer is the only supported library installation method now. --- admin/tool/phpunit/cli/util.php | 9 +++------ lib/phpunit/lib.php | 3 --- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/admin/tool/phpunit/cli/util.php b/admin/tool/phpunit/cli/util.php index 13dcacc03fe..a4da37456fe 100644 --- a/admin/tool/phpunit/cli/util.php +++ b/admin/tool/phpunit/cli/util.php @@ -50,16 +50,13 @@ list($options, $unrecognized) = cli_get_params( ) ); -if (file_exists(__DIR__.'/../../../../vendor/phpunit/phpunit/PHPUnit/Autoload.php')) { +if (file_exists(__DIR__.'/../../../../vendor/phpunit/phpunit/composer.json')) { // Composer packages present. require_once(__DIR__.'/../../../../vendor/autoload.php'); - require_once(__DIR__.'/../../../../vendor/phpunit/phpunit/PHPUnit/Autoload.php'); } else { - // Verify PHPUnit PEAR libs can be loaded. - if (!include('PHPUnit/Autoload.php')) { - phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITMISSING); - } + // Note: installation via PEAR is not supported any more. + phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITMISSING); } if ($options['install'] or $options['drop']) { diff --git a/lib/phpunit/lib.php b/lib/phpunit/lib.php index 86f8e413434..e01c804224f 100644 --- a/lib/phpunit/lib.php +++ b/lib/phpunit/lib.php @@ -25,9 +25,6 @@ // NOTE: MOODLE_INTERNAL is not verified here because we load this before setup.php! -require_once('PHPUnit/Autoload.php'); -require_once('PHPUnit/Extensions/Database/Autoload.php'); - require_once(__DIR__.'/classes/util.php'); require_once(__DIR__.'/classes/event_mock.php'); require_once(__DIR__.'/classes/event_sink.php');