Skip to content

Commit 41e1f9e

Browse files
committed
Improve tests to 80% MSI
Signed-off-by: George Steel <george@net-glue.co.uk>
1 parent d2fbba8 commit 41e1f9e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/EscaperTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ protected function setUp(): void
2828
public function testSettingEncodingToEmptyStringShouldThrowException(): void
2929
{
3030
$this->expectException(InvalidArgumentException::class);
31+
$this->expectExceptionMessage(
32+
'Laminas\Escaper\Escaper constructor parameter does not allow a blank value',
33+
);
3134
/** @psalm-suppress InvalidArgument */
3235
new Escaper('');
3336
}
@@ -86,6 +89,10 @@ public function testSettingValidEncodingShouldNotThrowExceptions(string $encodin
8689
public function testSettingEncodingToInvalidValueShouldThrowException(): void
8790
{
8891
$this->expectException(InvalidArgumentException::class);
92+
$this->expectExceptionMessage(
93+
'Value of \'invalid-encoding\' passed to Laminas\Escaper\Escaper '
94+
. 'constructor parameter is invalid. Provide an encoding supported by htmlspecialchars()',
95+
);
8996
new Escaper('invalid-encoding');
9097
}
9198

@@ -406,7 +413,7 @@ public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges(): void
406413
self::assertNotEquals(
407414
$literal,
408415
$this->escaper->escapeHtmlAttr($literal),
409-
$literal . ' should be escaped!'
416+
$literal . ' should be escaped!',
410417
);
411418
}
412419
}

0 commit comments

Comments
 (0)