You are here

travis-run-test.sh in Schemata 8

#!/bin/bash

# Run either PHPUnit tests or CODE_QUALITY tests on Travis CI, depending
# on the passed in parameter.
#
# Adapted from https://github.com/Gizra/og/blob/8.x-1.x/scripts/travis-ci/run-test.sh

case "$1" in
    CODE_QUALITY)
        cd $MODULE_DIR
        echo "ENSURE DEVELOPMENT TOOLS"
        composer install
        echo "VALIDATE COMPOSER.JSON FILE"
        composer validate --no-check-lock --no-check-publish --no-interaction
        echo "RUN CODE QUALITY CHECKS"
        composer run-script quality
        exit $?
        ;;
    *)
        echo "RUN PHPUNIT TESTS"
        ln -sv $MODULE_DIR $DRUPAL_DIR/modules/schemata
        cd $DRUPAL_DIR
        ./vendor/bin/phpunit -c ./core/phpunit.xml.dist $MODULE_DIR/tests
        exit $?
esac

File

bin/travis-run-test.sh
View source
  1. #!/bin/bash
  2. # Run either PHPUnit tests or CODE_QUALITY tests on Travis CI, depending
  3. # on the passed in parameter.
  4. #
  5. # Adapted from https://github.com/Gizra/og/blob/8.x-1.x/scripts/travis-ci/run-test.sh
  6. case "$1" in
  7. CODE_QUALITY)
  8. cd $MODULE_DIR
  9. echo "ENSURE DEVELOPMENT TOOLS"
  10. composer install
  11. echo "VALIDATE COMPOSER.JSON FILE"
  12. composer validate --no-check-lock --no-check-publish --no-interaction
  13. echo "RUN CODE QUALITY CHECKS"
  14. composer run-script quality
  15. exit $?
  16. ;;
  17. *)
  18. echo "RUN PHPUNIT TESTS"
  19. ln -sv $MODULE_DIR $DRUPAL_DIR/modules/schemata
  20. cd $DRUPAL_DIR
  21. ./vendor/bin/phpunit -c ./core/phpunit.xml.dist $MODULE_DIR/tests
  22. exit $?
  23. esac