From 8b6e2e6623339eb0611c56343422253257dfecab Mon Sep 17 00:00:00 2001 From: tyler36 Date: Fri, 16 Feb 2024 12:29:01 +0900 Subject: [PATCH] allow local phpunit config --- commands/web/phpunit | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/commands/web/phpunit b/commands/web/phpunit index 2b030ab..359c5f8 100755 --- a/commands/web/phpunit +++ b/commands/web/phpunit @@ -12,4 +12,12 @@ if ! command -v phpunit >/dev/null; then echo "phpunit is not available. You may need to 'ddev composer install'" exit 1 fi -phpunit web/modules/custom "$@" + +# CHECK for local config. +if [ -f "phpunit.xml" ]; then + # Defer to local config + phpunit "$@" +else + # Bootstrap Drupal tests and run all custom module tests. + phpunit --printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php --testdox $DDEV_DOCROOT/modules/custom "$@" +fi