I have installed multiple PHP versions on my Mac and want to run unit-tests against a specific PHP version (or against multipls versions)
Here\'s the php versions I
$ /Applications/MAMP/bin/php/php5.2.17/bin/php path/to/phpunit.phar
phpunit-using-5.2
#!/bin/sh
set -e
/Applications/MAMP/bin/php/php5.2.17/bin/php path/to/phpunit.phar "$@"
Now you can run it:
$ phpunit-using-5.2
Or you can create a bash alias too.
I had two version of php, default is 7.4 and older is 7.3, so I can test my testcase with older version like this.
php7.3 ./vendor/bin/phpunit