From 920fa7feb9822c5d0a9f922cd2cd2314a1749aca Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Wed, 15 Feb 2023 18:24:24 +0100 Subject: [PATCH] Add composer phpunit:coverage script --- DEVELOPMENT.md | 9 +++++++++ composer.json | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index d4963808..59a0c07c 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -137,6 +137,15 @@ at least `phpdbg -qrr`(which has problems with switch case statements) as using php -d pcov.enabled=1 -d pcov.directory=. vendor/bin/phpunit --testsuite Unit --coverage-text ``` +If using the Docker-based development environment +you can run the following script to retrieve a coverage report. +```sh +docker compose exec es_workspace composer phpunit:coverage +``` + +A browsable HTML version is available at http://localhost:5080/coverage/index.html . + + ### Var Dump server Symfony Var Dump server is configured to allow for easier debugging. It is not meant as a replacement for xdebug but can actually be used together with xdebug. This Var Dump Server is especially useful for when you want to debug a request without messing up the output e.g API calls ot HTML layout. diff --git a/composer.json b/composer.json index 7ba7e5e8..0db0769c 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,9 @@ "composer phpcs:setup", "phpcbf -p" ], - "phpstan": "phpstan" + "phpstan": "phpstan", + "phpunit": "phpunit", + "phpunit:coverage": "phpunit --coverage-text --coverage-html ./public/coverage/" }, "require": { "php": ">=8.1.0",