diff options
author | Andrew Dolgov <[email protected]> | 2022-12-13 20:00:46 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-12-13 20:00:46 +0300 |
commit | 0226e0ca0dc70f9a0310b3eef045ee1c1e0ca3ac (patch) | |
tree | 254c0e880693c2636107308b5931951cfa501311 /vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php |
split into a separate repo
Diffstat (limited to 'vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php')
-rw-r--r-- | vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php b/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php new file mode 100644 index 0000000..72c26a4 --- /dev/null +++ b/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php @@ -0,0 +1,28 @@ +<?php + +namespace Masterminds\HTML5\Tests\Parser; + +use Masterminds\HTML5\Parser\UTF8Utils; + +class UTF8UtilsTest extends \Masterminds\HTML5\Tests\TestCase +{ + public function testConvertToUTF8() + { + $out = UTF8Utils::convertToUTF8('éàa', 'ISO-8859-1'); + $this->assertEquals('éà a', $out); + } + + /** + * @todo add tests for invalid codepoints + */ + public function testCheckForIllegalCodepoints() + { + $smoke = 'Smoke test'; + $err = UTF8Utils::checkForIllegalCodepoints($smoke); + $this->assertEmpty($err); + + $data = "Foo Bar \0 Baz"; + $errors = UTF8Utils::checkForIllegalCodepoints($data); + $this->assertContains('null-character', $errors); + } +} |