예제 #1
0
 /**
  * test Emojione::unicodeToImage()
  *
  * @return void
  */
 public function testUnicodeToImage()
 {
     $test = 'Hello world! 😄 :smile:';
     $expected = 'Hello world! <span class="emojione-1F604" title=":smile:">😄</span> :smile:';
     $this->assertEquals(Emojione::unicodeToImage($test), $expected);
 }
예제 #2
0
 /**
  * test Emojione::unicodeToImage()
  *
  * @return void
  */
 public function testUnicodeToImage()
 {
     $test = 'Hello world! 😄 :smile:';
     $expected = 'Hello world! <img class="emojione" alt="😄" src="//cdn.jsdelivr.net/emojione/assets/png/1F604.png' . $this->cacheBustParam . '"/> :smile:';
     $this->assertEquals(Emojione::unicodeToImage($test), $expected);
 }
예제 #3
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);
 }