/docker-phpunit

PHPUnit docker image

Primary LanguageDockerfileMIT LicenseMIT

PHPUnit

Docker Pulls Back project

Image includes php (cli), composer, xdebug and phpunit.
It's derived from jitesoft/composer.

Tags

Each version has a base tag of php_version-phpunit_version where php version is major and minor version (I.E., 7.3, 7.2 etc) and phpunit is the major version (I.E., 9, 8 etc).
The latest and stable images are using the latest version of php and phpunit, all includes composer and xdebug.

Each tag is built for amd64 and arm64.

Docker Hub

  • jitesoft/phpunit

GitLab

  • registry.gitlab.com/jitesoft/dockerfiles/phpunit

GitHub

  • ghcr.io/jitesoft/phpunit

Dockerfile can be found at GitLab or GitHub

Usage

Enter directory in which you intend to run phpunit from. Run the desired command with:

docker run --rm -v $(pwd):/app jitesoft/phpunit --configuration phpunit.xml

Debugging

To get Xdebug to turn on its debugger you will need to set the environmental variable XDEBUG_MODE.

docker run --rm -e XDEBUG_MODE=debug -v $(pwd):/app jitesoft/phpunit --configuration phpunit.xml

Or in docker compose:

phpunit:
    container_name: phpunit
    image: jitesoft/phpunit:8.2
    environment:
      - "XDEBUG_MODE=debug"
    volumes:
      - "./php:/app/"
      - "./conf/phpunit/docker-php-ext-xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
      - "./conf/phpunit/xdebug.log:/var/log/xdebug.log"

Image labels

This image follows the Jitesoft image label specification 1.0.0.

Licenses

The files in this repository are released under the MIT License.
Composer is released under the MIT license.
Read the PHP license here.
Read the phpunit license here.

Sponsors

Jitesoft images are built via GitLab CI on runners hosted by the following wonderful organisations:

Oregon State University - Open Source Lab

The companies above are not affiliated with Jitesoft or any Jitesoft Projects directly.


Sponsoring is vital for the further development and maintaining of open source.
Questions and sponsoring queries can be made by email.
If you wish to sponsor our projects, reach out to the email above or visit any of the following sites:

Open Collective
GitHub Sponsors
Patreon