Skip to content

Commit

Permalink
MDL-32323 always verify that database PHPUnit extension is available
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Apr 10, 2012
1 parent c691274 commit 4e5ff72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions admin/tool/phpunit/cli/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
phpunit_bootstrap_error(130);
}

if (!@include_once('PHPUnit/Extensions/Database/Autoload.php')) {
phpunit_bootstrap_error(130);
}

if ($options['run']) {
unset($options);
unset($unrecognized);
Expand Down
2 changes: 1 addition & 1 deletion lib/phpunit/bootstraplib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/phpunit/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4e5ff72

Please sign in to comment.