diff --git a/tests/src/Content/SmiliesTest.php b/tests/src/Content/SmiliesTest.php
index 2882eeb8d5..69236efe2d 100644
--- a/tests/src/Content/SmiliesTest.php
+++ b/tests/src/Content/SmiliesTest.php
@@ -38,13 +38,13 @@ class SmiliesTest extends FixtureTestCase
return [
/** @see https://github.com/friendica/friendica/pull/6933 */
'bug-6933-1' => [
- 'data' => '/
',
- 'smilies' => ['texts' => [], 'icons' => []],
+ 'data' => '/
',
+ 'smilies' => ['texts' => [], 'icons' => []],
'expected' => '/
',
],
'bug-6933-2' => [
- 'data' => 'code
',
- 'smilies' => ['texts' => [], 'icons' => []],
+ 'data' => 'code
',
+ 'smilies' => ['texts' => [], 'icons' => []],
'expected' => 'code
',
],
];
@@ -72,56 +72,56 @@ class SmiliesTest extends FixtureTestCase
return [
'emoji' => [
'expected' => true,
- 'body' => '๐',
+ 'body' => '๐',
],
'emojis' => [
'expected' => true,
- 'body' => '๐๐คท',
+ 'body' => '๐๐คท',
],
'emoji+whitespace' => [
'expected' => true,
- 'body' => ' ๐ ',
+ 'body' => ' ๐ ',
],
'empty' => [
'expected' => false,
- 'body' => '',
+ 'body' => '',
],
'whitespace' => [
'expected' => false,
- 'body' => '
+ 'body' => '
',
],
'emoji+ASCII' => [
'expected' => false,
- 'body' => '๐คทa',
+ 'body' => '๐คทa',
],
'HTML entity whitespace' => [
'expected' => false,
- 'body' => ' ',
+ 'body' => ' ',
],
'HTML entity else' => [
'expected' => false,
- 'body' => '°',
+ 'body' => '°',
],
'emojis+HTML whitespace' => [
'expected' => true,
- 'body' => '๐ ๐คท',
+ 'body' => '๐ ๐คท',
],
'emojis+HTML else' => [
'expected' => false,
- 'body' => '๐<๐คท',
+ 'body' => '๐<๐คท',
],
'zwj' => [
'expected' => true,
- 'body' => '๐จโ๐จโ๐งโ',
+ 'body' => '๐จโ๐จโ๐งโ',
],
'zwj+whitespace' => [
'expected' => true,
- 'body' => ' ๐จโ๐จโ๐งโ ',
+ 'body' => ' ๐จโ๐จโ๐งโ ',
],
'zwj+HTML whitespace' => [
'expected' => true,
- 'body' => ' ๐จโ๐จโ๐งโ ',
+ 'body' => ' ๐จโ๐จโ๐งโ ',
],
];
}
@@ -139,59 +139,59 @@ class SmiliesTest extends FixtureTestCase
$data = [
'simple-1' => [
'expected' => 'alt=":-p"',
- 'body' => ':-p',
+ 'body' => ':-p',
],
'simple-2' => [
'expected' => 'alt=":-p"',
- 'body' => ' :-p ',
+ 'body' => ' :-p ',
],
'word-boundary-1' => [
'expected' => ':-pppp',
- 'body' => ':-pppp',
+ 'body' => ':-pppp',
],
'word-boundary-2' => [
'expected' => '~friendicaca',
- 'body' => '~friendicaca',
+ 'body' => '~friendicaca',
],
'symbol-boundary-1' => [
'expected' => 'alt=":-p"',
- 'body' => '(:-p)',
+ 'body' => '(:-p)',
],
'hearts-1' => [
'expected' => 'โค (โค) โค',
- 'body' => '<3 (<3) <3',
+ 'body' => '<3 (<3) <3',
],
'hearts-8' => [
'expected' => '(โคโคโคโคโคโคโคโค)',
- 'body' => '(<33333333)',
+ 'body' => '(<33333333)',
],
'no-hearts-1' => [
'expected' => '(<30)',
- 'body' => '(<30)',
+ 'body' => '(<30)',
],
'no-hearts-2' => [
'expected' => '(3<33)',
- 'body' => '(3<33)',
+ 'body' => '(3<33)',
],
'space' => [
'expected' => 'alt="smiley-heart"',
- 'body' => ':smiley heart 333:',
+ 'body' => ':smiley heart 333:',
],
'substitution-1' => [
'expected' => '🔥',
- 'body' => 'โฝ',
+ 'body' => 'โฝ',
],
'substitution-2' => [
'expected' => '🤗',
- 'body' => ':hugging face:',
+ 'body' => ':hugging face:',
],
'substitution-3' => [
'expected' => '🤭',
- 'body' => ':face with hand over mouth:',
+ 'body' => ':face with hand over mouth:',
],
'mixed' => [
'expected' => '🔥 🤭 invalid:hugging face: 🤗',
- 'body' => 'โฝ :face with hand over mouth: invalid:hugging face: :hugging face:',
+ 'body' => 'โฝ :face with hand over mouth: invalid:hugging face: :hugging face:',
],
];
@@ -199,10 +199,10 @@ class SmiliesTest extends FixtureTestCase
foreach (['A', '_', ':', '-'] as $prefix) {
foreach (['', ' ', 'A', ':', '-'] as $suffix) {
$no_smile = ($prefix !== '' && ctype_alnum($prefix)) || ($suffix !== '' && ctype_alnum($suffix));
- $s = $prefix . $emoji . $suffix;
- $data[] = [
+ $s = $prefix . $emoji . $suffix;
+ $data[] = [
'expected' => $no_smile ? $s : 'alt="' . $emoji . '"',
- 'body' => $s,
+ 'body' => $s,
];
}
}
@@ -223,58 +223,58 @@ class SmiliesTest extends FixtureTestCase
{
return [
'symbols' => [
- 'expected' => ['p', 'heart', 'embarrassed', 'kiss'],
- 'body' => ':-p <3 ":-[:-"',
+ 'expected' => ['p', 'heart', 'embarrassed', 'kiss'],
+ 'body' => ':-p <3 ":-[:-"',
'normalized' => ':p: :heart: ":embarrassed::kiss:',
],
'single-smiley' => [
- 'expected' => ['like'],
- 'body' => ':like',
+ 'expected' => ['like'],
+ 'body' => ':like',
'normalized' => ':like:',
],
'multiple-smilies' => [
- 'expected' => ['like', 'dislike'],
- 'body' => ':like :dislike',
+ 'expected' => ['like', 'dislike'],
+ 'body' => ':like :dislike',
'normalized' => ':like: :dislike:',
],
'nosmile' => [
- 'expected' => [],
- 'body' => '[nosmile] :like :like',
+ 'expected' => [],
+ 'body' => '[nosmile] :like :like',
'normalized' => '[nosmile] :like :like'
],
'in-code' => [
- 'expected' => [],
- 'body' => '[code]:like :like :like[/code]',
+ 'expected' => [],
+ 'body' => '[code]:like :like :like[/code]',
'normalized' => '[code]:like :like :like[/code]'
],
'~friendica' => [
- 'expected' => ['friendica'],
- 'body' => '~friendica',
+ 'expected' => ['friendica'],
+ 'body' => '~friendica',
'normalized' => ':friendica:'
],
'space' => [
- 'expected' => ['smileyheart333'],
- 'body' => ':smiley heart 333:',
+ 'expected' => ['smileyheart333'],
+ 'body' => ':smiley heart 333:',
'normalized' => ':smileyheart333:'
],
'substitution-1' => [
- 'expected' => [],
- 'body' => 'โฝ',
+ 'expected' => [],
+ 'body' => 'โฝ',
'normalized' => '🔥',
],
'substitution-2' => [
- 'expected' => [],
- 'body' => ':hugging face:',
+ 'expected' => [],
+ 'body' => ':hugging face:',
'normalized' => '🤗',
],
'substitution-3' => [
- 'expected' => [],
- 'body' => ':face with hand over mouth:',
+ 'expected' => [],
+ 'body' => ':face with hand over mouth:',
'normalized' => '🤭',
],
'mixed' => [
- 'expected' => [],
- 'body' => 'โฝ :face with hand over mouth: invalid:hugging face: :hugging face:',
+ 'expected' => [],
+ 'body' => 'โฝ :face with hand over mouth: invalid:hugging face: :hugging face:',
'normalized' => '🔥 🤭 invalid:hugging face: 🤗',
],
];
@@ -286,7 +286,7 @@ class SmiliesTest extends FixtureTestCase
public function testExtractUsedSmilies(array $expected, string $body, string $normalized): void
{
$extracted = Smilies::extractUsedSmilies($body, $converted);
- $expected = array_fill_keys($expected, true);
+ $expected = array_fill_keys($expected, true);
$this->assertEquals($normalized, $converted);
foreach (array_keys($extracted) as $shortcode) {
$this->assertArrayHasKey($shortcode, $expected);