Skip to content

Commit 70db6f9

Browse files
authored
Merge pull request #15 from timkrase/fix/unit-tests-new-badge
Fix: unit tests after updated badge
2 parents 9394490 + b532e4d commit 70db6f9

File tree

16 files changed

+249
-194
lines changed

16 files changed

+249
-194
lines changed

clover.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<coverage generated="1648495904">
3-
<project timestamp="1648495904">
2+
<coverage generated="1674763184">
3+
<project timestamp="1674763184">
44
<file name="/home/runner/work/phpunit-coverage-badge/phpunit-coverage-badge/src/BadgeGenerator.php">
55
<class name="PhpUnitCoverageBadge\BadgeGenerator" namespace="global">
66
<metrics complexity="7" methods="4" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="19" coveredstatements="19" elements="23" coveredelements="23"/>
@@ -183,17 +183,16 @@
183183
</file>
184184
<file name="/home/runner/work/phpunit-coverage-badge/phpunit-coverage-badge/src/ReportParser/ReportParserFactory.php">
185185
<class name="PhpUnitCoverageBadge\ReportParser\ReportParserFactory" namespace="global">
186-
<metrics complexity="4" methods="1" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="6" coveredstatements="6" elements="7" coveredelements="7"/>
186+
<metrics complexity="4" methods="1" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="5" coveredstatements="5" elements="6" coveredelements="6"/>
187187
</class>
188188
<line num="11" type="method" name="createReportParser" visibility="public" complexity="4" crap="4" count="3"/>
189-
<line num="13" type="stmt" count="3"/>
190189
<line num="14" type="stmt" count="3"/>
191190
<line num="15" type="stmt" count="1"/>
192191
<line num="16" type="stmt" count="2"/>
193192
<line num="17" type="stmt" count="1"/>
194193
<line num="19" type="stmt" count="1"/>
195194
<line num="22" type="stmt" count="1"/>
196-
<metrics loc="21" ncloc="21" classes="1" methods="1" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="6" coveredstatements="6" elements="7" coveredelements="7"/>
195+
<metrics loc="21" ncloc="21" classes="1" methods="1" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="5" coveredstatements="5" elements="6" coveredelements="6"/>
197196
</file>
198197
<file name="/home/runner/work/phpunit-coverage-badge/phpunit-coverage-badge/src/ReportParser/ReportParserInterface.php">
199198
<line num="11" type="stmt" count="1"/>
@@ -224,6 +223,6 @@
224223
<line num="44" type="stmt" count="4"/>
225224
<metrics loc="43" ncloc="43" classes="1" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="16" coveredstatements="16" elements="18" coveredelements="18"/>
226225
</file>
227-
<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"/>
226+
<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"/>
228227
</project>
229228
</coverage>

template.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/BadgeGeneratorTest.php

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,25 @@
77
class BadgeGeneratorTest extends TestCase
88
{
99
const VALID_BADGE = <<<EOT
10-
<svg width="100" height="20" xmlns="http://www.w3.org/2000/svg">
11-
<!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->
12-
13-
<g>
14-
<rect fill="none" id="canvas_background" height="22" width="102" y="-1" x="-1"/>
15-
</g>
16-
<g>
17-
<rect rx="2" id="svg_1" height="18" width="98" y="1" x="1" stroke-width="1.5" stroke="#4c4c4c" fill="#4c4c4c"/>
18-
<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>
19-
<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>
20-
<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"/>
21-
<rect id="svg_7" height="18" width="10" y="1.01077" x="58.00804" stroke-width="1.5" stroke="#e05d44" fill="#e05d44"/>
22-
<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>
23-
<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>
24-
</g>
10+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="108" height="20" role="img">
11+
<linearGradient id="s" x2="0" y2="100%">
12+
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
13+
<stop offset="1" stop-opacity=".1"/>
14+
</linearGradient>
15+
<clipPath id="r">
16+
<rect width="108" height="20" rx="3" fill="#fff"/>
17+
</clipPath>
18+
<g clip-path="url(#r)">
19+
<rect width="63" height="20" fill="#555"/>
20+
<rect x="63" width="45" height="20" fill="#e05d44"/>
21+
<rect width="108" height="20" fill="url(#s)"/>
22+
</g>
23+
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110">
24+
<text aria-hidden="true" x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="530">coverage</text>
25+
<text x="315" y="140" transform="scale(.1)" fill="#fff" textLength="530">coverage</text>
26+
<text aria-hidden="true" x="850" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="350">11 %</text>
27+
<text x="850" y="140" transform="scale(.1)" fill="#fff" textLength="350">11 %</text>
28+
</g>
2529
</svg>
2630
EOT;
2731

tests/resources/0.svg

Lines changed: 20 additions & 16 deletions
Loading
Lines changed: 17 additions & 13 deletions
Loading
Lines changed: 17 additions & 13 deletions
Loading
Lines changed: 17 additions & 13 deletions
Loading

0 commit comments

Comments
 (0)