diff options
author | Florian Pritz <bluewind@xinu.at> | 2021-02-21 11:08:30 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2021-02-21 11:08:30 +0100 |
commit | 29e6c8ad462a426f4bc6d380646e434e3361a21d (patch) | |
tree | 121e7ec9a5aa926a7cfffc40f33fdc156fac4d76 | |
parent | 78b9b272de889809bf05529bf91cc94829a5f9e6 (diff) |
PHP8: Update code coverage plugin for compabtibility
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | composer.json | 2 | ||||
-rw-r--r-- | public_html/index.php | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/composer.json b/composer.json index b656d8a53..3c77414f3 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "paragonie/random_compat": "Provides better randomness in PHP 5.x" }, "require-dev": { - "phpunit/php-code-coverage": "^4 || ^5 || ^6 || ^7 || ^8", + "phpunit/php-code-coverage": "^9 || ^10", "ext-xdebug": "*" } } diff --git a/public_html/index.php b/public_html/index.php index aa9e12ec4..930737eb1 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -359,11 +359,11 @@ if (getenv("ENVIRONMENT") === "testsuite" && getenv("COLLECT_COVERAGE") == 1) { if ($testname) { include APPPATH."../vendor/autoload.php"; $filter = new \SebastianBergmann\CodeCoverage\Filter(); - $filter->addDirectoryToWhitelist(APPPATH); - $filter->removeDirectoryFromWhitelist(APPPATH."/third_party/"); + $filter->includeDirectory(APPPATH); + $filter->excludeDirectory(APPPATH."/third_party/"); // Force phpdbg for speed //$driver = new \SebastianBergmann\CodeCoverage\Driver\PHPDBG(); - $driver = null; + $driver = (new \SebastianBergmann\CodeCoverage\Driver\Selector)->forLineCoverage($filter); $coverage = new \SebastianBergmann\CodeCoverage\CodeCoverage($driver, $filter); $coverage->start($testname); } |