mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-32323 all-in-one PHPUnit init script
This commit is contained in:
parent
6aaae357c9
commit
4b17369567
4 changed files with 32 additions and 6 deletions
24
admin/tool/phpunit/cli/init.sh
Executable file
24
admin/tool/phpunit/cli/init.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
CLIDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
UTIL="$CLIDIR/util.php"
|
||||
|
||||
echo "Building phpunit.xml and initialising test database..."
|
||||
|
||||
php $UTIL --buildconfig
|
||||
RESULT=$?
|
||||
if [ $RESULT -gt 0 ] ; then
|
||||
exit $RESULT
|
||||
fi
|
||||
|
||||
php $UTIL --drop
|
||||
RESULT=$?
|
||||
if [ $RESULT -gt 0 ] ; then
|
||||
exit $RESULT
|
||||
fi
|
||||
|
||||
php $UTIL --install
|
||||
RESULT=$?
|
||||
if [ $RESULT -gt 0 ] ; then
|
||||
exit $RESULT
|
||||
fi
|
|
@ -31,6 +31,12 @@
|
|||
|
||||
define('PHPUNIT_UTIL', true);
|
||||
|
||||
// verify PHPUnit installation
|
||||
if (!@include_once('PHPUnit/Autoload.php')) {
|
||||
fwrite(STDERR, "Can not load PHPUnit PEAR library, is it installed?\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
require(__DIR__ . '/../../../../lib/phpunit/bootstrap.php');
|
||||
require_once($CFG->libdir.'/phpunit/lib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue