Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add integration tests for group
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Oct 12, 2021
commit 3487aeeb1f49b80ed6a9d1441e13c7511e2dc822
7 changes: 6 additions & 1 deletion tests/lib/Comments/CommentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ public function mentionsProvider() {
[
'Also @"guest/0123456789abcdef" are now supported', [], null, ['guest/0123456789abcdef']
],
[
'Also @"group/My Group ID 321" are now supported', [], null, [], ['My Group ID 321']
],
];
}

Expand All @@ -171,7 +174,7 @@ public function mentionsProvider() {
* @param string|null $author
* @param array $expectedGuests
*/
public function testMentions(string $message, array $expectedUids, ?string $author = null, array $expectedGuests = []): void {
public function testMentions(string $message, array $expectedUids, ?string $author = null, array $expectedGuests = [], array $expectedGroups = []): void {
$comment = new Comment();
$comment->setMessage($message);
if (!is_null($author)) {
Expand All @@ -183,6 +186,8 @@ public function testMentions(string $message, array $expectedUids, ?string $auth
$id = array_shift($expectedUids);
} elseif ($mention['type'] === 'guest') {
$id = array_shift($expectedGuests);
} elseif ($mention['type'] === 'group') {
$id = array_shift($expectedGroups);
} else {
$this->fail('Unexpected mention type');
continue;
Expand Down