Join GitHub today
Developement environment preparation #7
I would suggest you to add instructions on how to build the same development environment as yours. For example, a short introduction on virtual box, vagrant or at least puPHPet would be nice to have as a chapter. Why do I say so? I say so because I tried to run unit tests on Windows computer (I use one with Windows 8.1 OS) and then I got some major errors... I was not able to run unit tests the way you wrote (for example, at page 103 of the first edition book). Running the same commands on Linux results in success.
Many thanks for The Book! It helps a lot.
pushed a commit
Mar 25, 2015
Hi slaff, you are quite fast with changes. Happy to see the result. However, running unit tests does not work for me. I get exactly the same result as before (see the previous link to stackoverflow). I am not so sure why I am going into the same situation over and over again, but I have some assumptions on reasons.. I will test more in coming days. Will give a feedback.
@slaff The line of composer.json file used in the book: "phpunit/phpunit" : "3.7.*"
I have changed
Tested on Windows 8.1, Ubuntu Trusty 14.04 LTS x64, the isolated development environment you provide. Works well.
There is also a way to make PHPUnit 3.7.* work on all systems (same systems tested by me), but the command must be changed to:
So... Here we have two ways mentioned to go with PHPUnit tests to make them work. It is up to you to decide witch of two is better. I would prefer the one with increasing PHPUnit version to 4.5 at the moment.
As far as I have tested the isolated development environment you provide - the environment works well. Of course, except the PHPUnit tests part. By the way, as mentioned in stackowerflow, I have tried running PHPUnit 3.7.* in my shared hosting environment (I believe it has RedHat or CentOS installed) and the examples from the book worked well in that hosting environment.
Environment configuration changes to make the environment fit the latest version of the book (vs.) code changes to make code portable. What is the right way to go?