Files
firefly-iii/pu.sh

41 lines
728 B
Bash
Raw Normal View History

2015-03-28 06:48:38 +01:00
#!/bin/bash
2015-04-03 07:44:44 +02:00
# set testing environment
cp .env.testing .env
2015-03-28 06:51:54 +01:00
2015-04-03 07:44:44 +02:00
# test!
2015-04-05 10:36:28 +02:00
if [ -z "$1" ]
then
phpunit --verbose
fi
2015-06-19 08:38:21 +02:00
# directories to look in:
dirs=("controllers" "database" "factories" "helpers" "models" "middleware" "repositories" "support")
2015-04-05 10:36:28 +02:00
if [ ! -z "$1" ]
then
2015-06-19 08:38:21 +02:00
for i in "${dirs[@]}"
do
firstFile="./tests/$i/$1.php"
secondFile="./tests/$i/$1Test.php"
if [ -f "$firstFile" ]
then
# run it!
phpunit --verbose $firstFile
exit $?
fi
if [ -f "$secondFile" ]
then
# run it!
phpunit --verbose $secondFile
exit $?
fi
done
2015-04-05 10:36:28 +02:00
fi
2015-04-03 07:44:44 +02:00
# restore .env file
2015-04-20 21:57:20 +02:00
cp .env.local .env