unit-xdebug 669 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. display_help() {
  3. echo -e "Description:
  4. Run unit tests with xdebug (you need to turn on xdebug in IDE as usual)
  5. Usage:
  6. bin/test/unit-xdebug <unit_test_path>
  7. Arguments:
  8. <unit_test_path> Specify a path to your test or folder with tests Ex: bin/test/unit-xdebug app/code/Vendor/Module
  9. Options:
  10. -h, --help Display help message"
  11. }
  12. if [[ $1 == "-h" || $1 == "--help" ]]; then
  13. display_help
  14. elif [[ -z $1 ]]; then
  15. echo -e "Please specify a path to your test or folder with tests (ex. app/code/Vendor/Module)"
  16. else
  17. bin/php -d xdebug.start_with_request=yes vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist /var/www/html/"$1"
  18. fi