mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 20:16:22 +00:00
Skeletons for test
This commit is contained in:
28
test.sh
28
test.sh
@@ -7,13 +7,15 @@ BACKUPENV=./.env.current
|
||||
TESTINGENV=./.env.testing
|
||||
|
||||
# do something with flags:
|
||||
rflag=''
|
||||
tflag=''
|
||||
resetestflag=''
|
||||
testflag=''
|
||||
coverageflag=''
|
||||
|
||||
while getopts 'rt' flag; do
|
||||
while getopts 'crt' flag; do
|
||||
case "${flag}" in
|
||||
r) rflag='true' ;;
|
||||
t) tflag='true' ;;
|
||||
r) resetestflag='true' ;;
|
||||
t) testflag='true' ;;
|
||||
c) coverageflag='true' ;;
|
||||
*) error "Unexpected option ${flag}" ;;
|
||||
esac
|
||||
done
|
||||
@@ -32,7 +34,7 @@ cp $TESTINGENV $ORIGINALENV
|
||||
php artisan cache:clear
|
||||
|
||||
# reset database (optional)
|
||||
if [[ $rflag == "true" ]]
|
||||
if [[ $resetestflag == "true" ]]
|
||||
then
|
||||
echo "Must reset database"
|
||||
|
||||
@@ -51,7 +53,7 @@ then
|
||||
fi
|
||||
|
||||
# do not reset database (optional)
|
||||
if [[ $rflag == "" ]]
|
||||
if [[ $resetestflag == "" ]]
|
||||
then
|
||||
echo "Will not reset database"
|
||||
fi
|
||||
@@ -60,12 +62,20 @@ fi
|
||||
cp $DATABASECOPY $DATABASE
|
||||
|
||||
# run PHPUnit
|
||||
if [[ $tflag == "" ]]
|
||||
if [[ $testflag == "" ]]
|
||||
then
|
||||
echo "Must not run PHPUnit"
|
||||
else
|
||||
echo "Must run PHPUnit"
|
||||
phpunit
|
||||
|
||||
if [[ $coverageflag == "" ]]
|
||||
then
|
||||
echo "Must run PHPUnit without coverage"
|
||||
phpunit
|
||||
else
|
||||
echo "Must run PHPUnit with coverage"
|
||||
phpunit --configuration phpunit.coverage.xml
|
||||
fi
|
||||
fi
|
||||
|
||||
# restore current config:
|
||||
|
Reference in New Issue
Block a user