-
Notifications
You must be signed in to change notification settings - Fork 642
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Works around elvanto/litemoji#36 by only calling LitEmoji::unicodeToShortcode() for 4-byte character sequences
- Loading branch information
1 parent
0f04477
commit 263ead7
Showing
5 changed files
with
90 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1551,6 +1551,28 @@ public function testIdnToUtf8Email(string $expected, string $string): void | |
self::assertSame($expected, $actual); | ||
} | ||
|
||
/** | ||
* @dataProvider emojiToShortcodesDataProvider | ||
* | ||
* @param string $expected | ||
* @param string $str | ||
*/ | ||
public function testEmojiToShortcodes(string $expected, string $str) | ||
{ | ||
self::assertSame($expected, StringHelper::emojiToShortcodes($str)); | ||
} | ||
|
||
/** | ||
* @dataProvider shortcodesToEmojiDataProvider | ||
* | ||
* @param string $expected | ||
* @param string $str | ||
*/ | ||
public function testShortcodesToEmoji(string $expected, string $str) | ||
{ | ||
self::assertSame($expected, StringHelper::shortcodesToEmoji($str)); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
|
@@ -4186,4 +4208,26 @@ public function idnToUtf8EmailDataProvider(): array | |
['aaa@äö.ee', '[email protected]'], | ||
]; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function emojiToShortcodesDataProvider(): array | ||
{ | ||
return [ | ||
['Baby you light my :fire:! :smiley:', 'Baby you light my 🔥! 😃'], | ||
['Test — em – en - dashes :hand_with_index_and_middle_fingers_crossed:', 'Test — em – en - dashes 🤞'], | ||
]; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function shortcodesToEmojiDataProvider(): array | ||
{ | ||
return [ | ||
['Baby you light my 🔥! 😃', 'Baby you light my :fire:! :smiley:'], | ||
['Test — em – en - dashes 🤞', 'Test — em – en - dashes :hand_with_index_and_middle_fingers_crossed:'], | ||
]; | ||
} | ||
} |