phpunit-docker icon indicating copy to clipboard operation
phpunit-docker copied to clipboard

DEPRECATED :package: Docker image to use PHPUnit as CLI.

PHPUnit Docker Container.

Docker pull Docker pull Github issues License

Docker container to install and run PHPUnit.

Features

Installation / Usage

  1. Install the phpunit/phpunit container:

    $ docker pull phpunit/phpunit
    
  2. Create a phpunit.xml defining your tests suites.

    ...
    
  3. 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:

  1. Download the source:

    $ git clone https://github.com/JulienBreux/phpunit-docker.git
    
  2. Switch to the phpunit-docker directory:

    $ cd phpunit-docker
    
  3. Build the container:

    $ docker build -t phpunit/phpunit .
    
  4. Test running the container:

    $ docker run phpunit/phpunit --help
    

How to generate?

Install associate GEMs

$ gem install bundle
$ bundle

Generate a new version

version=6.5.3 rake version:add

Remove a version

An error in your generation?

version=6.5.3 rake version:remove