diff options
author | Andrew Dolgov <[email protected]> | 2022-07-31 09:15:00 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-07-31 09:15:00 +0300 |
commit | 7187ab859db71fd706a6ea67587b21ad0fe588df (patch) | |
tree | 0c36632720ec06fb18dd999132fffdb55284fb8c /plugins/af_readability/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php | |
parent | 4aefbd628e9a0e1eac58523904ad887b0635cda3 (diff) |
fork masterminds html5-php
Diffstat (limited to 'plugins/af_readability/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php')
-rw-r--r-- | plugins/af_readability/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/af_readability/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php b/plugins/af_readability/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php new file mode 100644 index 000000000..72c26a4b3 --- /dev/null +++ b/plugins/af_readability/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); + } +} |