Docker container to install and run PHPUnit.
-
Install the phpunit/phpunit container:
$ docker pull phpunit/phpunit
-
Create a phpunit.xml defining your tests suites.
...
-
Run PHPUnit through the PHPUnit container:
$ docker run -v $(pwd):/app --rm phpunit/phpunit run
or in shorthand add
$ sudo sh -c "printf \"#!/bin/sh export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin docker run -v $(pwd):/app --rm phpunit/phpunit run \\\$@ \" > /usr/local/bin/phpunit" $ sudo chmod +x /usr/local/bin/phpunit
and then from host machine just
$ phpunit --version
To run, test and develop the PHPUnit Dockerfile itself, you must use the source directly:
-
Download the source:
$ git clone https://github.com/JulienBreux/phpunit-docker.git
-
Switch to the phpunit-docker directory:
$ cd phpunit-docker
-
Build the container:
$ docker build -t phpunit/phpunit .
-
Test running the container:
$ docker run phpunit/phpunit --help
$ gem install bundle
$ bundle
version=6.5.3 rake version:add
An error in your generation?
version=6.5.3 rake version:remove