summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2021-02-21 11:31:51 +0100
committerFlorian Pritz <bluewind@xinu.at>2021-02-21 11:32:00 +0100
commit533e6b97deff819c3101bf81be884ea15a7b72b3 (patch)
tree8eb0dadc5b401635bb7da6c597be58c0f5fa2fab
parent252f2bfacd0b4a24a57d6774ce43bdaa3c29f4a2 (diff)
PHP8: Fix generation of code coverage report
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--application/controllers/Tools.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/application/controllers/Tools.php b/application/controllers/Tools.php
index 15f35cc9e..040f0c711 100644
--- a/application/controllers/Tools.php
+++ b/application/controllers/Tools.php
@@ -105,7 +105,10 @@ class Tools extends MY_Controller {
function generate_coverage_report()
{
include APPPATH."../vendor/autoload.php";
- $coverage = new \SebastianBergmann\CodeCoverage\CodeCoverage();
+ $filter = new \SebastianBergmann\CodeCoverage\Filter;
+ $coverage = new \SebastianBergmann\CodeCoverage\CodeCoverage(
+ (new \SebastianBergmann\CodeCoverage\Driver\Selector)->forLineCoverage($filter),
+ $filter);
foreach (glob(FCPATH."/test-coverage-data/*") as $file) {
$coverage->merge(unserialize(file_get_contents($file)));
}