Giter VIP home page Giter VIP logo

Comments (5)

slaff avatar slaff commented on June 10, 2024

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.

slaff avatar slaff commented on June 10, 2024

Created the https://github.com/slaff/learnzf2-box repository. The initial version of the Vagrant script will follow soon.

from learnzf2.

slaff avatar slaff commented on June 10, 2024

@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.

PauliusMacernis avatar PauliusMacernis commented on June 10, 2024

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.

PauliusMacernis avatar PauliusMacernis commented on June 10, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.