summaryrefslogtreecommitdiff
path: root/plugins/af_readability/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php
diff options
context:
space:
mode:
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.php28
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);
+ }
+}