public function testFourByteCharacterReverse() { $chr = twitter_api_utf8_chr(0x1f004); $this->assertSame("🀄", $chr); }
/** * Test common false positives */ public function testFancyQuotesIntact() { $test = array(0x2018, 0x2019, 0x201c, 0x201d); $validator = array($this, '_replace_valid'); foreach ($test as $code) { $hex = sprintf('%04x', $code); $leave = twitter_api_utf8_chr($code); $bytes = twitter_api_unicode_debug_string($leave); $valid = twitter_api_replace_emoji($leave, $validator); $this->assertEquals('invalid', $valid, 'U+' . $hex . ' wrongly matched: ' . $bytes); } }