MDL-32323 always verify that database PHPUnit extension is available

This commit is contained in:
Petr Skoda 2012-04-10 21:15:33 +02:00
parent c691274bf9
commit 4e5ff72ea7
3 changed files with 6 additions and 2 deletions

View File

@ -76,6 +76,10 @@ if (!@include_once('PHPUnit/Autoload.php')) {
phpunit_bootstrap_error(130);
}
if (!@include_once('PHPUnit/Extensions/Database/Autoload.php')) {
phpunit_bootstrap_error(130);
}
if ($options['run']) {
unset($options);
unset($unrecognized);

View File

@ -43,7 +43,7 @@ function phpunit_bootstrap_error($errorcode, $text = '') {
$text = 'Moodle requires PHPUnit 3.6.x, '.$text.' is not compatible';
break;
case 130:
$text = 'Moodle can not find PHPUnit PEAR library';
$text = 'Moodle can not find PHPUnit PEAR library or necessary PHPUnit extension';
break;
case 131:
$text = 'Moodle configuration problem: '.$text;

View File

@ -11,7 +11,7 @@ Documentation
Installation
------------
1. install PEAR package manager - see [PEAR Manual](http://pear.php.net/manual/en/installation.php)
2. install PHPUnit package - see [PHPUnit installation documentation](http://www.phpunit.de/manual/current/en/installation.html)
2. install PHPUnit package and phpunit/DbUnit extension - see [PHPUnit installation documentation](http://www.phpunit.de/manual/current/en/installation.html)
3. edit main config.php - add `$CFG->phpunit_prefix` and `$CFG->phpunit_dataroot` - see config-dist.php
4. execute `admin/tool/phpunit/cli/init.sh` to initialise the test environemnt, repeat it after every upgrade or installation of plugins