1
0
Fork 0
forked from mirror/pixelfed
This commit is contained in:
Daniel Supernault 2023-05-27 07:27:35 -06:00
parent ac9fb5f661
commit d4f92da0e5
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -109,31 +109,31 @@ class StatusLexerTest extends TestCase
/** @test * */
public function mentionLimit()
{
$text = '@test1 @test @test2 @test3 @test4 @test5 test post';
$text = '@test1 @test @test2 @test3 @test4 @test5 @test6 @test7 @test8 @test9 @test10 @test11 @test12 @test13 @test14 @test15 @test16 @test17 @test18 @test19 test post';
$entities = Extractor::create()->extract($text);
$count = count($entities['mentions']);
$this->assertEquals($count, Status::MAX_MENTIONS);
$this->assertEquals(Status::MAX_MENTIONS, $count);
}
/** @test * */
public function hashtagLimit()
{
$text = '#hashtag0 #hashtag1 #hashtag2 #hashtag3 #hashtag4 #hashtag5 #hashtag6 #hashtag7 #hashtag8 #hashtag9 #hashtag10 #hashtag11 #hashtag12 #hashtag13 #hashtag14 #hashtag15 #hashtag16 #hashtag17 #hashtag18 #hashtag19 #hashtag20 #hashtag21 #hashtag22 #hashtag23 #hashtag24 #hashtag25 #hashtag26 #hashtag27 #hashtag28 #hashtag29 #hashtag30 #hashtag31';
$text = '#hashtag0 #hashtag1 #hashtag2 #hashtag3 #hashtag4 #hashtag5 #hashtag6 #hashtag7 #hashtag8 #hashtag9 #hashtag10 #hashtag11 #hashtag12 #hashtag13 #hashtag14 #hashtag15 #hashtag16 #hashtag17 #hashtag18 #hashtag19 #hashtag20 #hashtag21 #hashtag22 #hashtag23 #hashtag24 #hashtag25 #hashtag26 #hashtag27 #hashtag28 #hashtag29 #hashtag30 #hashtag31 #hashtag0 #hashtag1 #hashtag2 #hashtag3 #hashtag4 #hashtag5 #hashtag6 #hashtag7 #hashtag8 #hashtag9 #hashtag10 #hashtag11 #hashtag12 #hashtag13 #hashtag14 #hashtag15 #hashtag16 #hashtag17 #hashtag18 #hashtag19 #hashtag20 #hashtag21 #hashtag22 #hashtag23 #hashtag24 #hashtag25 #hashtag26 #hashtag27 #hashtag28 #hashtag29 #hashtag30 #hashtag31';
$entities = Extractor::create()->extract($text);
$count = count($entities['hashtags']);
$this->assertEquals($count, Status::MAX_HASHTAGS);
$this->assertEquals(Status::MAX_HASHTAGS, $count);
}
/** @test * */
public function linkLimit()
{
$text = 'https://example.org https://example.net https://example.com';
$text = 'https://example.org https://example.net https://example.com https://example.com https://example.net';
$entities = Extractor::create()->extract($text);
$count = count($entities['urls']);
$this->assertEquals($count, Status::MAX_LINKS);
$this->assertEquals(Status::MAX_LINKS, $count);
}
}