Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / masterminds / html5 / test / HTML5 / Parser / UTF8UtilsTest.php
1 <?php
2
3 namespace Masterminds\HTML5\Tests\Parser;
4
5 use Masterminds\HTML5\Parser\UTF8Utils;
6
7 class UTF8UtilsTest extends \Masterminds\HTML5\Tests\TestCase
8 {
9         public function testConvertToUTF8() {
10                 $out = UTF8Utils::convertToUTF8('éàa', 'ISO-8859-1');
11                 $this->assertEquals('éàa', $out);
12         }
13
14         /**
15          * @todo add tests for invalid codepoints
16          */
17         public function testCheckForIllegalCodepoints() {
18                 $smoke = "Smoke test";
19                 $err = UTF8Utils::checkForIllegalCodepoints($smoke);
20                 $this->assertEmpty($err);
21
22                 $data = "Foo Bar \0 Baz";
23                 $errors = UTF8Utils::checkForIllegalCodepoints($data);
24                 $this->assertContains('null-character', $errors);
25         }
26 }