Just a quick note as I wiggled through that:
To run your unit-tests with different PHP Versions in Git Bash on Windows, there is not much use in changing the PHPBIN windows environment variable to make PHPUnit pick the right PHP binary.
Under Git Bash the phpunit file with the PHP shebang is used. So the quick and dirty fix is to duplicate the file and change the PHP interpreter, as in it’s first line:
#!c:\Programme\PHP\.\php.exe <?php /* PHPUnit * * Copyright (c) 2001-2012, Sebastian Bergmann <firstname.lastname@example.org>. * All rights reserved. * ...
It’s not really a very fine solution but it did it for the moment for me. I named the other file phpunit5.4 to tag the phpversion with it.
For PHPStorm compatiblity not much is needed to do. The only thing that I needed to do was to kill the PHPRC environment variable, otherwise PHPStorm would have picked the configuration from the default commandline PHP installation (still PHP 5.3 on that box).
For standard windows shell it’s just working by setting the PHPBIN variable:
> set PHPBIN=c:\Programme\PHP-5.4\php.exe > set PHPRC=
The second set is only necessary in case this has not been unset yet. Similar operations in git bash:
$ unset $PHPRC $ export -n PHPRC
As written changing the PHPBIN variable makes not much sense under bash. Maybe there is an easy way to even better streamline this, I was looking into that the first time. PHP 5.4 will become my default PHP version on the system anyway the next month, that version is just too good to give it secondary treatment.