Added tests

This commit is contained in:
Michael 2024-01-28 06:56:25 +00:00
parent d2702dfe9c
commit b948b2c7cb

View file

@ -214,4 +214,21 @@ class StringsTest extends TestCase
self::assertEquals($originalText, $text);
}
public function testCleanTags()
{
$rawTags = 'Open, #Source, Friendica Software; Federation #Fediverse';
$cleaned = 'federation,fediverse,friendica,open,software,source';
self::assertEquals($cleaned, Strings::cleanTags($rawTags));
}
public function testgetTagArrayByString()
{
$list = 'Open, #Source, Friendica Software; Federation #Fediverse';
$tags = ['federation', 'fediverse', 'friendica', 'open', 'software', 'source'];
self::assertEquals($tags, Strings::getTagArrayByString($list));
}
}