From f07d47334fa2b6aa77dfa7aae835b405ced2d1ac Mon Sep 17 00:00:00 2001 From: Joachim Noreiko Date: Tue, 25 Jun 2024 15:34:11 +0100 Subject: [PATCH] Changed to allow phpunit.xml file in project root. --- commands/web/phpunit | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/commands/web/phpunit b/commands/web/phpunit index 0e83730..37984d3 100644 --- a/commands/web/phpunit +++ b/commands/web/phpunit @@ -11,4 +11,13 @@ if ! command -v phpunit >/dev/null; then fi echo "Clearing old webdriver sessions" curl -f -s http://chrome:4444/status | jq -r '.value.nodes[].slots[].session.sessionId' | while read -r session; do if [ "$session" != "null" ]; then curl -X DELETE "http://chrome:4444/session/$session"; fi; done -phpunit -c core "$@" + +# Prefer a phpunit.xml file in the project root if one exists; fall back on the +# one in core if not. +if [ ! -f 'phpunit.xml' ]; then + phpunit_c_option="-c core" +else + phpunit_c_option="" +fi + +phpunit $phpunit_c_option "$@"