Skip to content

Commit bad3abf

Browse files
committed
Correct spelling and improve error handling in tests
This commit corrects a misspelling of 'manipulate' and changes the expected error type in BadgeComposerTest's finalizeCoverage method. The test now anticipates a Throwable exception when a badge template file is missing, enhancing error handling.
1 parent 2dfa014 commit bad3abf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/BadgeComposerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,14 @@ public function testItThrowsExceptionWhenFileProcessingFails(): void
110110
}
111111

112112
/**
113+
* @param bool $manipulate
113114
* @throws ReflectionException
114115
*/
115-
public function finalizeCoverage($manipuate = false)
116+
public function finalizeCoverage($manipulate = false)
116117
{
117118
$method = (new ReflectionClass($this->badgeComposer))->getMethod('finalizeCoverage');
118119

119-
if($manipuate) {
120+
if($manipulate) {
120121
$property = (new ReflectionClass($this->badgeComposer))->getProperty('badgeTemplate');
121122
$property->setValue($this->badgeComposer, 'invalid.svg');
122123
}
@@ -142,7 +143,7 @@ public function testFinalizeCoverageCalculatesAverageCoverage(): void
142143
*/
143144
public function testFinalizeCoverageFailsWhenBadgeTemplateFileIsMissing(): void
144145
{
145-
$this->expectException(Exception::class);
146+
$this->expectException(Throwable::class);
146147
$this->expectExceptionMessage('Error reading badge template file');
147148

148149
$this->finalizeCoverage(true);

0 commit comments

Comments
 (0)