Skip to content

Commit a206407

Browse files
authored
Merge pull request #3 from codebtech/feat/merge-reports
Adds composer lock file
2 parents 60fc13a + c96af06 commit a206407

File tree

3 files changed

+1743
-3
lines changed

3 files changed

+1743
-3
lines changed

Includes/BadgeComposer.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class BadgeComposer
1616
private array $inputFiles;
1717
private string $outputFile;
1818
private string $coverageName;
19-
public int $totalCoverage = 0;
19+
private int $totalCoverage = 0;
2020
private int $totalElements = 0;
2121
private int $checkedElements = 0;
2222

@@ -32,6 +32,16 @@ public function __construct(string $inputFiles, string $outputFile, string $cove
3232
$this->validateFiles($this->inputFiles, $this->outputFile);
3333
}
3434

35+
/**
36+
* Returns the total coverage percentage.
37+
*
38+
* @return int The total coverage percentage.
39+
*/
40+
public function getTotalCoverage(): int
41+
{
42+
return $this->totalCoverage;
43+
}
44+
3545
/**
3646
* Validates the input files and output file.
3747
*

Tests/BadgeComposerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testProcessTheCloverFileAndCalculateTheCoverage(): void
8181
{
8282
$this->processFile($this->inputFile);
8383

84-
$this->assertEquals(51, $this->badgeComposer->totalCoverage);
84+
$this->assertEquals(51, $this->badgeComposer->getTotalCoverage());
8585
}
8686

8787
/**
@@ -92,6 +92,6 @@ public function testProcessMultipleCloverFilesAndCalculateTheCoverage(): void
9292
$this->processFile($this->inputFile);
9393
$this->processFile($this->inputFile2);
9494

95-
$this->assertEquals(94, $this->badgeComposer->totalCoverage);
95+
$this->assertEquals(94, $this->badgeComposer->getTotalCoverage());
9696
}
9797
}

0 commit comments

Comments
 (0)