Skip to content

Commit

Permalink
Fix fails in project test script
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-m authored Sep 10, 2024
1 parent f421522 commit 51504fd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions commands/web/project-test-phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@ if [[ ! -f $PHPUNIT_BINARY ]]; then
exit 1
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

# Ensure prophecy.
# TODO: Remove this when Drupal core no longer requires it.
composer require --dev phpspec/prophecy-phpunit:^2 --no-progress --no-suggest --no-audit --no-interaction
composer require --dev phpspec/prophecy-phpunit:^2 --no-progress --no-audit --no-interaction

echo "Starting PHPUnit test run."
DDEV_PATH="$PWD"
Expand All @@ -34,7 +42,7 @@ DRUPAL_ROOT="/var/www/html/docroot" \
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 \
"$@"
PROJECT_TEST_RESULT=$?
Expand Down

0 comments on commit 51504fd

Please sign in to comment.