예제 #1
0
 /**
  * # 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);
 }
예제 #2
0
 /**
  * test Emojione::toShort()
  *
  * @return void
  */
 public function testToShort()
 {
     $test = 'Hello world! 😄 :smile:';
     $expected = 'Hello world! :smile: :smile:';
     $this->assertEquals(Emojione::toShort($test), $expected);
 }
예제 #3
0
function confer_convert_emoji_to_shortcodes($text)
{
    return \Emojione\Emojione::toShort($text);
}