Skip to content

Latest commit

 

History

History
55 lines (43 loc) · 1.27 KB

File metadata and controls

55 lines (43 loc) · 1.27 KB

PHP Sandbox

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.

Getting Started

Prerequisites

Start the Container

docker compose up -d --build

Install Composer Dependencies

./bin/composer install

Run the Tests

./bin/phpunit

Stop the Container

docker compose down --remove-orphans

GitHub Action Workflow

A GitHub Action Workflow is included that will run the tests when a pull request is opened or a push occurs to master or develop.

Configuration

PHP

  • The PHP image is configured using the Dockerfile with any additional configuration settings in the docker/php/config directory.

PHPUnit

  • src/phpunit.xml

Xdebug

  • docker/php/config/xdebug.ini

Scripts

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/phpunit

Reference Docs