gnu-social/vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php
Diogo Cordeiro 2a06261f75 [CORE][COMPOSER] Move extlib packages with immediate composer correspondent to composer dependencies
This adds a composer.json for all dependencies that are available
2019-08-03 17:47:24 +01:00

29 lines
730 B
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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);
}
}