9 namespace Friendica\Test\src\Content;
11 use Friendica\Content\Smilies;
13 use Friendica\Network\HTTPException\InternalServerErrorException;
14 use Friendica\Test\FixtureTest;
16 class SmiliesTest extends FixtureTest
18 protected function setUp(): void
22 DI::config()->set('system', 'no_smilies', false);
25 public function dataLinks()
28 /** @see https://github.com/friendica/friendica/pull/6933 */
30 'data' => '<code>/</code>',
31 'smilies' => ['texts' => [], 'icons' => []],
32 'expected' => '<code>/</code>',
35 'data' => '<code>code</code>',
36 'smilies' => ['texts' => [], 'icons' => []],
37 'expected' => '<code>code</code>',
43 * Test replace smilies in different texts
45 * @dataProvider dataLinks
47 * @param string $text Test string
48 * @param array $smilies List of smilies to replace
49 * @param string $expected Expected result
51 * @throws InternalServerErrorException
53 public function testReplaceFromArray(string $text, array $smilies, string $expected)
55 $output = Smilies::replaceFromArray($text, $smilies);
56 self::assertEquals($expected, $output);