Skip to content

phpvigo/docker-php-unit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Docker image to run phpUnit tests

docker run --env TEST_RUNNER_FRAMEWORK=S4 -v /path/to/your/application:/application phpvigo/php-test-runner:7.1

Environment vars

TEST_RUNNER_FRAMEWORK

Your framework or application. Accepted values:

  • S4: Symfony4 (default value)
  • S3: Symfony3
  • S2: Symfony2
  • lavarel: Laravel5
  • vendor: Other applications that have phpunit as composer require dev.
  • global: Your test are writing extending a global installation of PHP Unit

TEST_RUNNER_COVERAGE

Output the code coverage information. Accepted values:

  • true
  • false (default value)

TEST_RUNNER_COVERAGE_HTML

Export the test stats in HTML. Accepted values:

  • true
  • false (default value)

The output folder is the test folder into the public path. The public path is detected automatically by the TEST_RUNNER_FRAMEWORK value. You can "force" a specific folder with the env var TEST_RUNNER_COVERAGE_HTML_PATH

Using .env.test

You can set all environment vars into a .env.test file:

TEST_RUNNER_FRAMEWORK=S4
TEST_RUNNER_COVERAGE=true
TEST_RUNNER_COVERAGE_HTML=true

Examples

docker run --env TEST_RUNNER_FRAMEWORK=S4 -v /path/to/your/application:/application phpvigo/php-test-runner:7.1
docker run --env TEST_RUNNER_FRAMEWORK=S4 --env TEST_RUNNER_COVERAGE_HTML -v /path/to/your/application:/application phpvigo/php-test-runner:7.1
docker run --env-file ./env.test -v /path/to/your/application:/application phpvigo/php-test-runner:7.1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published