You are here

test.sh in Site Audit 8.2

#!/usr/bin/env sh

# This script is a modified form of the script present in devel
# module for running drush command file tests.
#
# The original can be found at
# http://cgit.drupalcode.org/devel/tree/run-tests-drush.sh?id=refs/heads;id2=8.x-1.x
#
# This script will run phpunit-based test classes using Drush's
# test framework.  First, the Drush executable is located, and
# then phpunit is invoked, pointing to Drush's phpunit.xml as
# the configuration.
#
# Any parameters that may be passed to `phpunit` may also be used
# with this script.

if [ ! -f "./vendor/bin/phpunit" ]
then
   echo "phpunit not found; please run 'composer install --dev'"
   exit 1
fi
export UNISH_NO_TIMEOUTS=y
export UNISH_DRUPAL_MAJOR_VERSION=8

# The following line is needed is you use a `drush` that differs from `which drush`
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
DRUSH_DIRNAME=$DIR/vendor/drush/drush
export UNISH_DRUSH=$DRUSH_DIRNAME/drush
if [ $# = 0 ] ; then
   $DIR/vendor/bin/phpunit --configuration="$DRUSH_DIRNAME/tests" tests
else
   # Pass along any arguments.
   $DIR/vendor/bin/phpunit --configuration="$DRUSH_DIRNAME/tests" $@
fi

File

test.sh
View source
  1. #!/usr/bin/env sh
  2. # This script is a modified form of the script present in devel
  3. # module for running drush command file tests.
  4. #
  5. # The original can be found at
  6. # http://cgit.drupalcode.org/devel/tree/run-tests-drush.sh?id=refs/heads;id2=8.x-1.x
  7. #
  8. # This script will run phpunit-based test classes using Drush's
  9. # test framework. First, the Drush executable is located, and
  10. # then phpunit is invoked, pointing to Drush's phpunit.xml as
  11. # the configuration.
  12. #
  13. # Any parameters that may be passed to `phpunit` may also be used
  14. # with this script.
  15. if [ ! -f "./vendor/bin/phpunit" ]
  16. then
  17. echo "phpunit not found; please run 'composer install --dev'"
  18. exit 1
  19. fi
  20. export UNISH_NO_TIMEOUTS=y
  21. export UNISH_DRUPAL_MAJOR_VERSION=8
  22. # The following line is needed is you use a `drush` that differs from `which drush`
  23. DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
  24. DRUSH_DIRNAME=$DIR/vendor/drush/drush
  25. export UNISH_DRUSH=$DRUSH_DIRNAME/drush
  26. if [ $# = 0 ] ; then
  27. $DIR/vendor/bin/phpunit --configuration="$DRUSH_DIRNAME/tests" tests
  28. else
  29. # Pass along any arguments.
  30. $DIR/vendor/bin/phpunit --configuration="$DRUSH_DIRNAME/tests" $@
  31. fi