mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-32323 improve PHPUnit related diagnotic messages
This commit is contained in:
parent
e10736b3cc
commit
b6b8a19316
@ -1,4 +1,6 @@
|
||||
@ECHO OFF
|
||||
ECHO Initialising Moodle PHPUnit test environment...
|
||||
|
||||
CALL php %~dp0\util.php --diag > NUL 2>&1
|
||||
|
||||
IF ERRORLEVEL 133 GOTO drop
|
||||
|
@ -6,7 +6,7 @@ CLIDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
|
||||
UTIL="$CLIDIR/util.php"
|
||||
|
||||
echo "Initialising test database and creating phpunit.xml configuration..."
|
||||
echo "Initialising Moodle PHPUnit test environment..."
|
||||
|
||||
DIGERROR=`php $UTIL --diag`
|
||||
DIAG=$?
|
||||
|
@ -45,10 +45,10 @@ function phpunit_bootstrap_error($errorcode, $text = '') {
|
||||
$text = 'Configuration problem: '.$text;
|
||||
break;
|
||||
case 132:
|
||||
$text = 'Database was not initialised to run unit tests, please use "php admin/tool/phpunit/cli/util.php --install"';
|
||||
$text = "Moodle PHPUnit environment is not initialised, please use:\n php admin/tool/phpunit/cli/util.php --install";
|
||||
break;
|
||||
case 133:
|
||||
$text = 'Database was initialised for different version, please use "php admin/tool/phpunit/cli/util.php --drop; php admin/tool/phpunit/cli/util.php --install"';
|
||||
$text = "Moodle PHPUnit environment was initialised for different version, please use:\n php admin/tool/phpunit/cli/util.php --drop\n php admin/tool/phpunit/cli/util.php --install";
|
||||
break;
|
||||
case 134:
|
||||
$text = 'Can not create main configuration file, please verify dirroot permissions.';
|
||||
|
@ -673,9 +673,9 @@ class phpunit_util {
|
||||
if ($DB->get_tables()) {
|
||||
list($errorcode, $message) = phpunit_util::testing_ready_problem();
|
||||
if ($errorcode) {
|
||||
phpunit_bootstrap_error(133, 'Database tables already installed, drop the site first.');
|
||||
phpunit_bootstrap_error(133, 'Database tables already present, Moodle PHPUnit test environment can not be initialised');
|
||||
} else {
|
||||
phpunit_bootstrap_error(0, 'Test database is already initialised');
|
||||
phpunit_bootstrap_error(0, 'Moodle PHPUnit test environment is already initialised');
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user