An easy to stand up Dockerized environment with PHP, Composer, PHPUnit, Mockery, and Xdebug.
The goal is to be able to run PHPUnit tests easily and debug them.
docker compose up -d --build./bin/composer install./bin/phpunitdocker compose down --remove-orphansA GitHub Action Workflow is included that will run the tests when a pull request is opened or a push occurs to master or develop.
PHP
- The PHP image is configured using the
Dockerfilewith any additional configuration settings in thedocker/php/configdirectory.
PHPUnit
src/phpunit.xml
Xdebug
docker/php/config/xdebug.ini
These are located in /bin and are intended to be shorthand for running commands within the PHP container.
Examples:
./bin/phpunit --list-tests./bin/composer require --dev phpunit/phpunitReference Docs