mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Can now also test event code.
This commit is contained in:
22
test.sh
22
test.sh
@@ -10,13 +10,18 @@ TESTINGENV=./.env.testing
|
||||
resetTestFlag=''
|
||||
testflag=''
|
||||
coverageflag=''
|
||||
|
||||
featureflag=''
|
||||
featuretestclass=''
|
||||
|
||||
unitflag=''
|
||||
unittestclass=''
|
||||
|
||||
verbalflag=''
|
||||
testsuite=''
|
||||
configfile='phpunit.xml';
|
||||
|
||||
while getopts 'vcrtf:s:' flag; do
|
||||
while getopts 'vcrtf:u:s:' flag; do
|
||||
case "${flag}" in
|
||||
r)
|
||||
resetTestFlag='true'
|
||||
@@ -37,6 +42,11 @@ while getopts 'vcrtf:s:' flag; do
|
||||
featuretestclass=./tests/Feature/$OPTARG
|
||||
echo "Will only run Feature test $OPTARG"
|
||||
;;
|
||||
u)
|
||||
unitflag='true'
|
||||
unittestclass=./tests/Unit/$OPTARG
|
||||
echo "Will only run Unit test $OPTARG"
|
||||
;;
|
||||
s)
|
||||
testsuite="--testsuite $OPTARG"
|
||||
echo "Will only run test suite '$OPTARG'"
|
||||
@@ -45,7 +55,7 @@ while getopts 'vcrtf:s:' flag; do
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $coverageflag == "true" && $featureflag == "true" ]]
|
||||
if [[ $coverageflag == "true" && ($featureflag == "true" || $unitflag == "true") ]]
|
||||
then
|
||||
echo "Use config file specific.xml"
|
||||
configfile='phpunit.coverage.specific.xml'
|
||||
@@ -109,12 +119,12 @@ else
|
||||
then
|
||||
echo "Must run PHPUnit without coverage:"
|
||||
|
||||
echo "phpunit $verbalflag --configuration $configfile $featuretestclass $testsuite"
|
||||
phpunit $verbalflag --configuration $configfile $featuretestclass $testsuite
|
||||
echo "phpunit $verbalflag --configuration $configfile $featuretestclass $unittestclass $testsuite"
|
||||
phpunit $verbalflag --configuration $configfile $featuretestclass $unittestclass $testsuite
|
||||
else
|
||||
echo "Must run PHPUnit with coverage"
|
||||
echo "phpunit $verbalflag --configuration $configfile $featuretestclass $testsuite"
|
||||
phpunit $verbalflag --configuration $configfile $featuretestclass $testsuite
|
||||
echo "phpunit $verbalflag --configuration $configfile $featuretestclass $unittestclass $testsuite"
|
||||
phpunit $verbalflag --configuration $configfile $featuretestclass $unittestclass $testsuite
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user