mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Fix test script.
This commit is contained in:
@@ -14,7 +14,7 @@ install:
|
|||||||
- php artisan env
|
- php artisan env
|
||||||
- mv -v .env.testing .env
|
- mv -v .env.testing .env
|
||||||
- php artisan env
|
- php artisan env
|
||||||
- ./test.sh --notest
|
- ./test.sh --notest --reset
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- phpunit
|
- phpunit
|
26
test.sh
26
test.sh
@@ -1,19 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DATABASE=storage/database/database.sqlite
|
DATABASE=./storage/database/database.sqlite
|
||||||
DATABASECOPY=storage/database/databasecopy.sqlite
|
DATABASECOPY=./storage/database/databasecopy.sqlite
|
||||||
|
ORIGINALENV=./.env
|
||||||
|
BACKUPENV=./.env.current
|
||||||
|
TESTINGENV=./.env.testing
|
||||||
|
|
||||||
|
# backup current config (if it exists):
|
||||||
# backup current config:
|
if [ -f $ORIGINALENV ]; then
|
||||||
mv .env .env.current
|
mv $ORIGINALENV $BACKUPENV
|
||||||
|
fi
|
||||||
|
|
||||||
# enable testing config
|
# enable testing config
|
||||||
cp .env.testing .env
|
cp $TESTINGENV $ORIGINALENV
|
||||||
|
|
||||||
# clear cache:
|
# clear cache:
|
||||||
php artisan cache:clear
|
php artisan cache:clear
|
||||||
|
|
||||||
if [ "$1" == "--reset" ]; then
|
if [[ "$@" == "--reset" ]]
|
||||||
|
then
|
||||||
echo "Must reset database"
|
echo "Must reset database"
|
||||||
|
|
||||||
# touch files to make sure they exist.
|
# touch files to make sure they exist.
|
||||||
@@ -34,11 +39,14 @@ fi
|
|||||||
cp $DATABASECOPY $DATABASE
|
cp $DATABASECOPY $DATABASE
|
||||||
|
|
||||||
# run PHPUnit
|
# run PHPUnit
|
||||||
if [ "$1" == "--notest" ]; then
|
if [[ "$@" == "--notest" ]]
|
||||||
|
then
|
||||||
echo "Must not run PHPUnit"
|
echo "Must not run PHPUnit"
|
||||||
else
|
else
|
||||||
phpunit
|
phpunit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# restore current config:
|
# restore current config:
|
||||||
mv .env.current .env
|
if [ -f $BACKUPENV ]; then
|
||||||
|
mv $BACKUPENV $ORIGINALENV
|
||||||
|
fi
|
Reference in New Issue
Block a user