/** * # characters inside of OBJECT tag * * @return void */ public function testShortnameInsideOfObjectTag() { $unicode = 'The <object class="emojione" data="//cdn.jsdelivr.net/emojione/assets/svg/1f40c.svg" type="image/svg+xml" standby="🐌">🐌</object> is Emoji One\'s official mascot'; $shortname = 'The <object class="emojione" data="//cdn.jsdelivr.net/emojione/assets/svg/1f40c.svg" type="image/svg+xml" standby=":snail:">:snail:</object> is Emoji One\'s official mascot'; $this->assertEquals(Emojione::toShort($unicode), $unicode); $this->assertEquals(Emojione::shortnameToImage($shortname), $shortname); $this->assertEquals(Emojione::shortnameToUnicode($shortname), $shortname); $this->assertEquals(Emojione::unicodeToImage($unicode), $unicode); $this->assertEquals(Emojione::toImage($unicode), $unicode); $this->assertEquals(Emojione::toImage($shortname), $shortname); }
/** * test Emojione::toShort() * * @return void */ public function testToShort() { $test = 'Hello world! 😄 :smile:'; $expected = 'Hello world! :smile: :smile:'; $this->assertEquals(Emojione::toShort($test), $expected); }
function confer_convert_emoji_to_shortcodes($text) { return \Emojione\Emojione::toShort($text); }