From d02abe8905d155332b27bf321cee03dc3c8a2960 Mon Sep 17 00:00:00 2001 From: Wilmer Arambula Date: Wed, 28 Feb 2024 13:24:48 -0300 Subject: [PATCH] Raise code coverage 100%. --- tests/SanitizeTest.php | 12 ++++++++++-- tests/Support/InputWidget.php | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 tests/Support/InputWidget.php diff --git a/tests/SanitizeTest.php b/tests/SanitizeTest.php index 863effa..1449c6d 100644 --- a/tests/SanitizeTest.php +++ b/tests/SanitizeTest.php @@ -4,7 +4,7 @@ namespace PHPForge\Html\Tests\Helper; -use PHPForge\{Html\Helper\Sanitize, Support\Assert}; +use PHPForge\{Html\Helper\Sanitize, Html\Helper\Tests\Support\InputWidget, Support\Assert}; final class SanitizeTest extends \PHPUnit\Framework\TestCase { @@ -22,7 +22,7 @@ public function testInitializate(): void ); } - public function testSantizeXSS(): void + public function testHtml(): void { $this->assertSame( 'click', @@ -65,4 +65,12 @@ public function testSantizeXSS(): void ) ); } + + public function testHtmlWithRenderInterface(): void + { + $this->assertSame( + '', + Sanitize::html(new InputWidget()) + ); + } } diff --git a/tests/Support/InputWidget.php b/tests/Support/InputWidget.php new file mode 100644 index 0000000..f9c5e53 --- /dev/null +++ b/tests/Support/InputWidget.php @@ -0,0 +1,20 @@ +render(); + } + + public function render(): string + { + return ''; + } +}