assertTrue(String::isUTF8('')); $this->assertTrue(String::isUTF8('éééé')); $this->assertFalse(String::isUTF8(utf8_decode('éééé'))); } /** * OOXML to PHP control character */ public function testControlCharacterOOXML2PHP() { $this->assertEquals('', String::controlCharacterOOXML2PHP('')); $this->assertEquals(chr(0x08), String::controlCharacterOOXML2PHP('_x0008_')); } /** * PHP to OOXML control character */ public function testControlCharacterPHP2OOXML() { $this->assertEquals('', String::controlCharacterPHP2OOXML('')); $this->assertEquals('_x0008_', String::controlCharacterPHP2OOXML(chr(0x08))); } /** * Test unicode conversion */ public function testToUnicode() { $this->assertEquals('a', String::toUnicode('a')); $this->assertEquals('\uc0{\u8364}', String::toUnicode('€')); $this->assertEquals('\uc0{\u233}', String::toUnicode('é')); } /** * Test remove underscore prefix */ public function testRemoveUnderscorePrefix() { $this->assertEquals('item', String::removeUnderscorePrefix('_item')); } }