]> git.mxchange.org Git - friendica.git/commitdiff
Added tests
authorMichael <heluecht@pirati.ca>
Sun, 28 Jan 2024 06:56:25 +0000 (06:56 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 28 Jan 2024 06:56:25 +0000 (06:56 +0000)
tests/src/Util/StringsTest.php

index 0ee7e0cdb6cdaaf917456836f001bae7129f095f..c3e1beb49cf862b4879446086677b89cd782563f 100644 (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));
+       }
+
 }