From b0beea984f7636f44998332290327c07743cd9e2 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Mon, 16 Sep 2024 21:05:51 +0200 Subject: [PATCH] feat(phpunit): Enable phpunit to collect coverage reports and save them as HTML Signed-off-by: provokateurin --- .gitignore | 1 + composer.json | 3 ++- tests/phpunit.xml | 29 +++++++++++++---------------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index f64e38b81..abb7570f3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ vendor js/ cypress/downloads/ .idea/ +tests/coverage/ diff --git a/composer.json b/composer.json index 923302bd3..553b2cc21 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ "psalm": "psalm --threads=$(nproc) --no-cache", "psalm:update-baseline": "psalm --threads=$(nproc) --no-cache --update-baseline", "psalm:fix": "psalm --no-cache --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType", - "test:unit": "vendor/bin/phpunit -c tests/phpunit.xml" + "test:unit": "phpunit -c tests/phpunit.xml", + "test:unit:coverage": "XDEBUG_MODE=coverage phpunit -c tests/phpunit.xml" }, "config": { "allow-plugins": { diff --git a/tests/phpunit.xml b/tests/phpunit.xml index 9de3fd95d..98c505a2e 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -6,20 +6,17 @@ verbose="true" convertDeprecationsToExceptions="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> - - - ../ - - - ../tests - - - - - - - . - ./stubs/ - - + + + ../lib + + + + + + + . + ./stubs/ + +