#!/usr/bin/env bash display_help() { echo -e "Description: Run unit tests with xdebug (you need to turn on xdebug in IDE as usual) Usage: bin/test/unit-xdebug Arguments: Specify a path to your test or folder with tests Ex: bin/test/unit-xdebug app/code/Vendor/Module Options: -h, --help Display help message" } if [[ $1 == "-h" || $1 == "--help" ]]; then display_help elif [[ -z $1 ]]; then echo -e "Please specify a path to your test or folder with tests (ex. app/code/Vendor/Module)" else bin/cli php -d xdebug.start_with_request=yes vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist /var/www/html/"$1" fi