diff --git a/commands/web/dkan-phpunit b/commands/web/dkan-phpunit index 851fe96..f55e0bf 100755 --- a/commands/web/dkan-phpunit +++ b/commands/web/dkan-phpunit @@ -34,6 +34,14 @@ if [[ ! -f $PHPUNIT_BINARY ]] ; then composer install --no-progress fi +# Use the weitzman/dtt bootstrap if it exists. +# Otherwise, Drupal's bootstrap. +# TODO Eventually we can remove this and just use Drupal core. +BOOTSTRAP_PATH=$DDEV_COMPOSER_ROOT/vendor/weitzman/drupal-test-traits/src/bootstrap.php +if [[ ! -f $BOOTSTRAP_PATH ]] ; then + BOOTSTRAP_PATH=$DDEV_COMPOSER_ROOT/$DOCROOT/core/tests/bootstrap.php +fi + echo "Starting PHPUnit test run." DDEV_PATH="$PWD" cd $TEST_PATH || exit 1 @@ -43,12 +51,12 @@ cd $TEST_PATH || exit 1 # - DRUPAL_ROOT # - SIMPLETEST_BASE_URL # - SIMPLETEST_DB -DRUPAL_ROOT="/var/www/html/docroot" \ +DRUPAL_ROOT=$DDEV_COMPOSER_ROOT/$DOCROOT \ SIMPLETEST_BASE_URL=$DDEV_PRIMARY_URL \ SIMPLETEST_DB="mysql://db:db@$DDEV_PROJECT-db:3306/db" \ $DDEV_PATH/$PHPUNIT_BINARY \ --testsuite "$TEST_SUITE" \ - --bootstrap /var/www/html/vendor/weitzman/drupal-test-traits/src/bootstrap.php \ + --bootstrap $BOOTSTRAP_PATH \ --fail-on-risky \ "$@" TEST_RESULTS=$? diff --git a/commands/web/dkan-test-phpunit b/commands/web/dkan-test-phpunit index 166ac71..72b984f 100755 --- a/commands/web/dkan-test-phpunit +++ b/commands/web/dkan-test-phpunit @@ -7,6 +7,11 @@ # Avoid some XDebug error messages. export XDEBUG_MODE=coverage +echo "**" +echo "* The dkan-test-phpunit command is deprecated." +echo "* Use dkan-phpunit instead." +echo "**" + TEST_PATH="docroot/modules/contrib/dkan" TEST_SUITE="DKAN Test Suite" PHPUNIT_BINARY=vendor/bin/phpunit