pier-infor/undercover

1.0.3 2021-01-05 21:51 UTC

This package is auto-updated.

Last update: 2024-11-06 06:09:44 UTC


README

TravsisBadgeBuild Coverage ScrutinizerScore Latest Stable Version Total Downloads Latest Unstable Version

Undercover is a php coverage checker. It runs against phpunit clover file format.

Setup

composer require pier-infor/undercover

Phpunit Setup

in phpunit.xml file add a log tag entry in logging element as sample below.

    <logging>
        <!--...-->
        <log type="coverage-clover" target="build/logs/clover.xml"/>
        <!--...-->
    </logging>

Integration

<?php

exit((new PierInfor\Undercover\Checker)->run());

Composer Integration

in composer.json file add a script entry as sample below.

"undercover": [
    "undercover -f build/logs/clover.xml -l85 -m86 -s84 -c78 -b"
]

Arguments

  • -f  ,  --file
    • clover file path.
  • -l  ,  --lines
    • threshold for covered lines.
  • -m  ,  --methods
    • threshold for covered methods.
  • -s  ,  --statements
    • threshold for covered statements.
  • -c  ,  --classes
    • threshold for covered classes.
  • -b  ,  --blocking
    • flag to set exit code to 1 when error happened.

(threshold as percent value)

Tests

tested with php from v7.3 up to v8.0.