From c2e04a11bfd5b0f14211c6308fe2d8a481f0aa22 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 19 Jan 2016 16:55:02 +0100 Subject: [PATCH] Updated run scripts for tests. --- cover.sh | 39 ++++++++++----------------------------- pu.sh | 40 ++++++++++------------------------------ 2 files changed, 20 insertions(+), 59 deletions(-) diff --git a/cover.sh b/cover.sh index 4311932be6..d492b09735 100755 --- a/cover.sh +++ b/cover.sh @@ -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 diff --git a/pu.sh b/pu.sh index 2f20bcb843..0029a63e66 100755 --- a/pu.sh +++ b/pu.sh @@ -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