Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions clover.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1648495904">
<project timestamp="1648495904">
<coverage generated="1674763184">
<project timestamp="1674763184">
<file name="/home/runner/work/phpunit-coverage-badge/phpunit-coverage-badge/src/BadgeGenerator.php">
<class name="PhpUnitCoverageBadge\BadgeGenerator" namespace="global">
<metrics complexity="7" methods="4" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="19" coveredstatements="19" elements="23" coveredelements="23"/>
Expand Down Expand Up @@ -183,17 +183,16 @@
</file>
<file name="/home/runner/work/phpunit-coverage-badge/phpunit-coverage-badge/src/ReportParser/ReportParserFactory.php">
<class name="PhpUnitCoverageBadge\ReportParser\ReportParserFactory" namespace="global">
<metrics complexity="4" methods="1" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="6" coveredstatements="6" elements="7" coveredelements="7"/>
<metrics complexity="4" methods="1" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="5" coveredstatements="5" elements="6" coveredelements="6"/>
</class>
<line num="11" type="method" name="createReportParser" visibility="public" complexity="4" crap="4" count="3"/>
<line num="13" type="stmt" count="3"/>
<line num="14" type="stmt" count="3"/>
<line num="15" type="stmt" count="1"/>
<line num="16" type="stmt" count="2"/>
<line num="17" type="stmt" count="1"/>
<line num="19" type="stmt" count="1"/>
<line num="22" type="stmt" count="1"/>
<metrics loc="21" ncloc="21" classes="1" methods="1" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="6" coveredstatements="6" elements="7" coveredelements="7"/>
<metrics loc="21" ncloc="21" classes="1" methods="1" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="5" coveredstatements="5" elements="6" coveredelements="6"/>
</file>
<file name="/home/runner/work/phpunit-coverage-badge/phpunit-coverage-badge/src/ReportParser/ReportParserInterface.php">
<line num="11" type="stmt" count="1"/>
Expand Down Expand Up @@ -224,6 +223,6 @@
<line num="44" type="stmt" count="4"/>
<metrics loc="43" ncloc="43" classes="1" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="16" coveredstatements="16" elements="18" coveredelements="18"/>
</file>
<metrics files="8" loc="418" ncloc="396" classes="7" methods="28" coveredmethods="21" conditionals="0" coveredconditionals="0" statements="142" coveredstatements="120" elements="170" coveredelements="141"/>
<metrics files="8" loc="418" ncloc="396" classes="7" methods="28" coveredmethods="21" conditionals="0" coveredconditionals="0" statements="141" coveredstatements="119" elements="169" coveredelements="140"/>
</project>
</coverage>
2 changes: 1 addition & 1 deletion template.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 19 additions & 15 deletions tests/BadgeGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@
class BadgeGeneratorTest extends TestCase
{
const VALID_BADGE = <<<EOT
<svg width="100" height="20" xmlns="http://www.w3.org/2000/svg">
<!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->

<g>
<rect fill="none" id="canvas_background" height="22" width="102" y="-1" x="-1"/>
</g>
<g>
<rect rx="2" id="svg_1" height="18" width="98" y="1" x="1" stroke-width="1.5" stroke="#4c4c4c" fill="#4c4c4c"/>
<text transform="matrix(0.95, 0, 0, 1.01133, 0.0809801, -0.0237383)" font-weight="normal" xml:space="preserve" text-anchor="start" font-family="'Trebuchet MS', Gadget, sans-serif" font-size="12" id="svg_8" y="14.45" x="2.8" stroke-width="0" stroke="#4c4c4c" fill="#6e747d">coverage</text>
<text transform="matrix(0.95, 0, 0, 1.01133, 0.0809801, -0.0237383)" font-weight="normal" xml:space="preserve" text-anchor="start" font-family="'Trebuchet MS', Gadget, sans-serif" font-size="12" id="svg_3" y="13.9" x="2.2" stroke-width="0" stroke="#4c4c4c" fill="#ffffff">coverage</text>
<rect rx="2" id="svg_5" height="18" width="40.90531" y="1.01077" x="58.13716" stroke-width="1.5" stroke="#e05d44" fill="#e05d44"/>
<rect id="svg_7" height="18" width="10" y="1.01077" x="58.00804" stroke-width="1.5" stroke="#e05d44" fill="#e05d44"/>
<text transform="matrix(0.95, 0, 0, 1.01133, 0.0809801, -0.0237383)" font-weight="normal" xml:space="preserve" text-anchor="end" font-family="'Trebuchet MS', Gadget, sans-serif" font-size="10" id="svg_10" y="14.35" x="99" stroke-width="0" stroke="#4c4c4c" fill="#6e747d">11 %</text>
<text transform="matrix(0.95, 0, 0, 1.01133, 0.0809801, -0.0237383)" font-weight="normal" xml:space="preserve" text-anchor="end" font-family="'Trebuchet MS', Gadget, sans-serif" font-size="10" id="svg_9" y="13.8" x="98.4" stroke-width="0" stroke="#4c4c4c" fill="#ffffff">11 %</text>
</g>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="108" height="20" role="img">
<linearGradient id="s" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<clipPath id="r">
<rect width="108" height="20" rx="3" fill="#fff"/>
</clipPath>
<g clip-path="url(#r)">
<rect width="63" height="20" fill="#555"/>
<rect x="63" width="45" height="20" fill="#e05d44"/>
<rect width="108" height="20" fill="url(#s)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110">
<text aria-hidden="true" x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="530">coverage</text>
<text x="315" y="140" transform="scale(.1)" fill="#fff" textLength="530">coverage</text>
<text aria-hidden="true" x="850" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="350">11 %</text>
<text x="850" y="140" transform="scale(.1)" fill="#fff" textLength="350">11 %</text>
</g>
</svg>
EOT;

Expand Down
36 changes: 20 additions & 16 deletions tests/resources/0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 17 additions & 13 deletions tests/resources/result_badges/0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 17 additions & 13 deletions tests/resources/result_badges/100.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 17 additions & 13 deletions tests/resources/result_badges/29.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading