You are here

class UTF8UtilsTest in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php \Masterminds\HTML5\Tests\Parser\UTF8UtilsTest

Hierarchy

  • class \Masterminds\HTML5\Tests\TestCase extends \Masterminds\HTML5\Tests\PHPUnit_Framework_TestCase

Expanded class hierarchy of UTF8UtilsTest

File

vendor/masterminds/html5/test/HTML5/Parser/UTF8UtilsTest.php, line 7

Namespace

Masterminds\HTML5\Tests\Parser
View source
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);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TestCase::DOC_CLOSE constant
TestCase::DOC_OPEN constant
TestCase::getInstance public function
TestCase::testFoo public function
TestCase::wrap protected function
UTF8UtilsTest::testCheckForIllegalCodepoints public function * @todo add tests for invalid codepoints
UTF8UtilsTest::testConvertToUTF8 public function