Skip to content
This repository has been archived by the owner on Jan 2, 2020. It is now read-only.

Latest commit

 

History

History
36 lines (23 loc) · 821 Bytes

README.md

File metadata and controls

36 lines (23 loc) · 821 Bytes

PHPUnit via Docker

Run PHPUnit without needing a PHP runtime installed on your docker host.

Installation

For example, to build PHPUnit 8.0.5:

$ docker build -t phpunit-docker:8.0.5 8.0.5/

Usage

For example, to run PHPUnit 8.0.5 on your application /path/to/app with config file phpunit.xml:

$ docker run -itv /path/to/app:/app phpunit-docker:8.0.5 -c phpunit.xml

This can be simplified by setting up an alias in your ~/.bashrc:

alias phpunit='docker run -itv "$PWD":/app phpunit-docker:8.0.5'

Then, running the image simply becomes:

$ cd /path/to/app
$ phpunit -c phpunit.xml

Roadmap

  • Autogenerate different PHPUnit versions using something like m4 (see here).