Putting together testing infrastructure for Curator has been an interesting project onto itself. On my wishlist was:
- Support for a wide range of PHP interpreter versions, at least 5.4 - current
- In addition to the unit test suite, be able to run full integration testing including reads/writes to actual FTP servers.
- Keep the test environment easy enough to replicate that it is feasible for developers to run all tests locally, before submitting a pull request.
By building on Docker and phpenv, I was able to meet these requirements, and create something with more general applicability. I call it Prophusion, because it provides ready access to over 140 PHP releases.
For a quick introduction to Prophusion including a YouTube of it in action, check out this slide deck.
I’ve since fully integrated Prophusion into the testing pipeline for Curator where it happily performs my unit and in-depth system tests in the cloud, but I also make a habit of running it on my development laptop and workstation at home as I develop. You can even run xdebug from within the Prophusion container to debug surprise test failures from an xdebug client on your docker host system…I’m currently doing that by setting the right environment variables when docker starts up in my curator-specific test environment. I’ll port those back to the prophusion-base entrypoint in the next release of the prophusion-base docker image.
Prophusion includes a base image for testing in the CLI (or FPM), and one with Apache integrated for your in-browser testing.