Updated run scripts for tests.

This commit is contained in:
James Cole 2016-01-19 16:55:02 +01:00
parent 00d059b8df
commit c2e04a11bf
2 changed files with 20 additions and 59 deletions

View File

@ -6,38 +6,19 @@ cp .env.testing .env
# set cover:
cp phpunit.cover.xml phpunit.xml
# test!
if [ -z "$1" ]
# delete test databases:
if [ -f storage/database/testing.db ]
then
phpdbg -qrr /usr/local/bin/phpunit
rm storage/database/testing.db
fi
# directories to look in:
#dirs=("controllers" "database" "factories" "generators" "helpers" "models" "middleware" "repositories" "support")
#
#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!
# phpunit --verbose $firstFile
# exit $?
# fi
# if [ -f "$secondFile" ]
# then
# # run it!
# phpunit --verbose $secondFile
# exit $?
# fi
#
#
# done
#
#fi
if [ -f storage/database/testing-copy.db ]
then
rm storage/database/testing-copy.db
fi
# test!
phpdbg -qrr /usr/local/bin/phpunit
# restore .env file
cp .env.local .env

40
pu.sh
View File

@ -3,39 +3,19 @@
# set testing environment
cp .env.testing .env
# test!
if [ -z "$1" ]
# delete test databases:
if [ -f storage/database/testing.db ]
then
#phpunit --verbose
phpunit
rm storage/database/testing.db
fi
# directories to look in:
#dirs=("controllers" "database" "factories" "generators" "helpers" "models" "middleware" "repositories" "support")
#
#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!
# phpunit --verbose $firstFile
# exit $?
# fi
# if [ -f "$secondFile" ]
# then
# # run it!
# phpunit --verbose $secondFile
# exit $?
# fi
#
#
# done
#
#fi
if [ -f storage/database/testing-copy.db ]
then
rm storage/database/testing-copy.db
fi
# test!
phpunit
# restore .env file
cp .env.local .env