Skip to content

openhost/opennemas-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

PHPUnit Docker Container.

Docker container to install and run PHPUnit.

This container assumes all dependencies (including PHPUnit) are defined in a composer.json file in your project. The phpunit executable should be installed in vendor/bin in the application directory.

Installation / Usage

  1. Install the opennemas/phpunit container:

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

    ...
  3. Run PHPUnit through the PHPUnit container:

    $ docker run -v $(pwd):/app --rm opennemas/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 opennemas/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/openhost/opennemas-phpunit.git
  2. Switch to the opennemas-phpunit directory:

    $ cd opennemas-phpunit
  3. Build the container:

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

    $ docker run opennemas/phpunit --help

About

Docker container to install and run PHPUnit.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published