From 78ccec53e0940f87c9fc3101c8f71f321cd535ae Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 20 May 2019 19:43:38 -0600 Subject: [PATCH] Update StatusLexerTest --- tests/Unit/Lexer/StatusLexerTest.php | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/Unit/Lexer/StatusLexerTest.php b/tests/Unit/Lexer/StatusLexerTest.php index 5b0fe37de..fb25ee306 100644 --- a/tests/Unit/Lexer/StatusLexerTest.php +++ b/tests/Unit/Lexer/StatusLexerTest.php @@ -62,4 +62,48 @@ class StatusLexerTest extends TestCase $expected = '@pixelfed hi, really like the website! #píxelfed'; $this->assertEquals($this->autolink, $expected); } + + /** @test **/ + public function remoteMention() + { + $expected = [ + "hashtags" => [ + "dansup", + ], + "urls" => [], + "mentions" => [ + "@dansup@mstdn.io", + "test", + ], + "replyto" => null, + "hashtags_with_indices" => [ + [ + "hashtag" => "dansup", + "indices" => [ + 0, + 7, + ], + ], + ], + "urls_with_indices" => [], + "mentions_with_indices" => [ + [ + "screen_name" => "@dansup@mstdn.io", + "indices" => [ + 8, + 24, + ], + ], + [ + "screen_name" => "test", + "indices" => [ + 25, + 30, + ], + ], + ], + ]; + $actual = Extractor::create()->extract('#dansup @dansup@mstdn.io @test'); + $this->assertEquals($actual, $expected); + } }