mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-13 16:00:13 +00:00
Better scripts (accept arguments)
This commit is contained in:
34
cover.sh
34
cover.sh
@@ -18,7 +18,39 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# test!
|
# test!
|
||||||
phpdbg -qrr /usr/local/bin/phpunit
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "Running all tests..."
|
||||||
|
phpunit --verbose
|
||||||
|
fi
|
||||||
|
|
||||||
|
# test selective..
|
||||||
|
dirs=("acceptance/Controllers" "acceptance/Controllers/Auth" "acceptance/Controllers/Chart" "unit")
|
||||||
|
#
|
||||||
|
if [ ! -z "$1" ]
|
||||||
|
then
|
||||||
|
for i in "${dirs[@]}"
|
||||||
|
do
|
||||||
|
firstFile="./tests/$i/$1.php"
|
||||||
|
secondFile="./tests/$i/$1Test.php"
|
||||||
|
if [ -f "$firstFile" ]
|
||||||
|
then
|
||||||
|
# run it!
|
||||||
|
echo "Now running $firstFile"
|
||||||
|
phpunit --verbose $firstFile
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
if [ -f "$secondFile" ]
|
||||||
|
then
|
||||||
|
# run it!
|
||||||
|
echo "Now running $secondFile"
|
||||||
|
phpunit --verbose $secondFile
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# restore .env file
|
# restore .env file
|
||||||
cp .env.local .env
|
cp .env.local .env
|
||||||
|
35
pu.sh
35
pu.sh
@@ -23,7 +23,40 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# test!
|
# test!
|
||||||
phpunit
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "Running all tests..."
|
||||||
|
phpunit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# test selective..
|
||||||
|
dirs=("acceptance/Controllers" "acceptance/Controllers/Auth" "acceptance/Controllers/Chart" "unit")
|
||||||
|
#
|
||||||
|
if [ ! -z "$1" ]
|
||||||
|
then
|
||||||
|
for i in "${dirs[@]}"
|
||||||
|
do
|
||||||
|
firstFile="./tests/$i/$1.php"
|
||||||
|
secondFile="./tests/$i/$1Test.php"
|
||||||
|
if [ -f "$firstFile" ]
|
||||||
|
then
|
||||||
|
# run it!
|
||||||
|
echo "Now running $firstFile"
|
||||||
|
phpunit --verbose $firstFile
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
if [ -f "$secondFile" ]
|
||||||
|
then
|
||||||
|
# run it!
|
||||||
|
echo "Now running $secondFile"
|
||||||
|
phpunit --verbose $secondFile
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# restore .env file
|
# restore .env file
|
||||||
cp .env.local .env
|
cp .env.local .env
|
||||||
|
Reference in New Issue
Block a user