Comments (5)
Hi sugalvojau, thanks for the great suggestion! We can think of adding instructions in the website to create such an environment( with Vagrant and Virtualbox ). If there is interest we can include these instructions also in the future versions of the book.
from learnzf2.
Created the https://github.com/slaff/learnzf2-box repository. The initial version of the Vagrant script will follow soon.
from learnzf2.
@sugalvojau The box can be downloaded and tested from https://github.com/slaff/learnzf2-box. It would be great if you can test it and give your feedback.
from learnzf2.
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.
from learnzf2.
@slaff The line of composer.json file used in the book: "phpunit/phpunit" : "3.7.*"
I am reading the first edition of the book, not so sure if the second edition contains the same line?
I have changed "phpunit/phpunit" : "3.7.*"
to "phpunit/phpunit" : "4.5.*"
in my own copy of the code as 4.5 version of PHPUnit is the current stable.
Then, of course: php composer.phar update
Then this one will work nicely:
ZF2_PATH=pwd
/vendor/zendframework/zendframework/library \php vendor/phpunit/phpunit/phpunit -c module/User/tests/
The command above is not the same as in the book.
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:
ZF2_PATH=pwd
/vendor/zendframework/zendframework/library \php vendor/phpunit/phpunit/composer/bin/phpunit -c module/User/tests/
The command above is not the same as in the book.
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?
from learnzf2.
Related Issues (5)
- Tag ch-debug-module in zf2 2.2.4 HOT 2
- Composer Config outdated HOT 4
- Debug module HOT 1
- Use ModuleManager event name constants. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learnzf2.