Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Master Zend Framework:
How to Build a Docker Test Environment
Sep 28, 2016 @ 16:20:40

The Master Zend Framework site continues their series covering the creation of a Docker-based testing environment in this second part highlighting the addition of testing support.

In the first part in this series on developing web applications using Docker, we saw how to create a local development environment using Docker; one ideally suited to creating Zend Expressive (or any other kind of PHP-based web application). But, what we didn’t cover was how to handle testing in a Docker-based environment.

[...] How do you run tests when working with Docker containers? After a bit of searching, I found that it’s not that difficult. But you have to use the right combination of commands.

Since unit tests can be run locally if need be (they shouldn't need any resources from the service if they're true unit tests) he focuses on acceptance testing. For his examples he uses the Codeception testing tool. He walks you through the setup of some simple tests based on the "home" page functionality of the Zend Expressive skeleton application. With that in place, he shows the updates that will need to be made to execute the tests from outside the instance via a "docker exec" call. The post finishes with a look at adding two other tools to the mix as well: Make and Phing.

tagged: docker test environment series part2 testing acceptance codeception make phing

Link: http://www.masterzendframework.com/how-to-build-a-docker-test-environment/


Trending Topics: