diff --git a/phpunit.coverage.xml b/phpunit.coverage.xml new file mode 100755 index 0000000000..75e3afd143 --- /dev/null +++ b/phpunit.coverage.xml @@ -0,0 +1,42 @@ + + + + + ./tests/acceptance + + + ./tests/unit + + + + + + + + + + ./app + + + vendor/ + + + + + + + + + + + + diff --git a/phpunit.xml b/phpunit.xml index 5e3d64c04c..d439428075 100755 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,19 +7,28 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" + beStrictAboutOutputDuringTests="true" stopOnFailure="true"> - - - - - ./tests + + ./tests/acceptance + + + ./tests/unit + + + + + - + ./app + + vendor/ + diff --git a/test.sh b/test.sh index b1e52c6932..6e6e8065c7 100755 --- a/test.sh +++ b/test.sh @@ -12,8 +12,9 @@ testflag='' coverageflag='' acceptancetestclass='' verbalflag='' +testsuite='' -while getopts 'vcrta:' flag; do +while getopts 'vcrta:s:' flag; do case "${flag}" in r) resetestflag='true' @@ -25,12 +26,17 @@ while getopts 'vcrta:' flag; do coverageflag='true' ;; v) - verbalflag=' -v' + verbalflag=' -v --debug' + echo "Will be verbal about it" ;; a) acceptancetestclass=./tests/acceptance/$OPTARG echo "Will only run acceptance test $OPTARG" ;; + s) + testsuite="--testsuite $OPTARG" + echo "Will only run test suite '$OPTARG'" + ;; *) error "Unexpected option ${flag}" ;; esac done @@ -85,11 +91,13 @@ else if [[ $coverageflag == "" ]] then - echo "Must run PHPUnit without coverage" - phpunit --stop-on-error $verbalflag $acceptancetestclass + echo "Must run PHPUnit without coverage:" + echo "phpunit --stop-on-error $verbalflag $acceptancetestclass $testsuite" + phpunit --stop-on-error $verbalflag $acceptancetestclass $testsuite else echo "Must run PHPUnit with coverage" - phpunit --stop-on-error $verbalflag --configuration phpunit.coverage.xml $acceptancetestclass + echo "phpunit --stop-on-error $verbalflag --configuration phpunit.coverage.xml $acceptancetestclass $testsuite" + phpunit --stop-on-error $verbalflag --configuration phpunit.coverage.xml $acceptancetestclass $testsuite fi fi