In an API project, we have composer.json set to the following:
{
"require-dev": {
"phpunit/phpunit": "4.7.*"
},
"require": {
"monolog/monolog": "1.5.*"
}
}
And, upon the first composer install everything was fine. Phpunit worked when invoked with vendor/bin/phpunit. My work machine is a Windows 7 OS, however we use git with this project, and when I work on this from another machine (Kubuntu 14.04), after doing git pull, I can no longer run unit tests with vendor/bin/phpunit - it fails with error that it cannot find vendor/bin/phpunit.
On the linux machine, I deleted the non-functioning executable vendor/bin/phpunit, and removed vendor/phpunit folder, and had composer replace it via composer update. At that point, I'm able to run unit tests again as before. However this doesn't work as seamlessly on Windows 7. It's trickier.
My question is: Am I doing something wrong by tracking the files through github and then working on various operating systems? Would I avoid this error if I only kept track of composer.json and keep the contents of vendor/phpunit/phpunit directory untracked (and let the files stay with their specific OS)? Thanks, Adam.