Skip to content

Latest commit

 

History

History
48 lines (28 loc) · 1.1 KB

extension-testing.md

File metadata and controls

48 lines (28 loc) · 1.1 KB

Extension Testing

"Potemkin"-Testing

Heads up! This section is under development.

TODO: see giiant tests

"Acception"-Testing

PHP library testing

You can use phd base images phundament/php-one for running unit tests of composer packages.

First you need to create a docker-compose.yml file containing the test configuration.

A basic example looks like the following:

test:
  image: phundament/php-one:5.6-fpm-4.6.0-beta1
  command: sh -c 'composer install && bin/phpunit'
  volumes:
    - ./:/app

We will use the phd image as a CLI container with composer pre-installed.

By mounting the working directory into /app, which is the WORKING_DIR inside the container, we can use commands like composer or bin/phpunit directly.

To run the default command from the test container, run

docker-compose run test

And a composer installation and unit tests will be run inside the container.

Examples