Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-02-15 13:16:48 +0300
committerGitHub <noreply@github.com>2022-02-15 13:16:48 +0300
commitb94951100381904da3eababcfd5f8c1db0ab1693 (patch)
treef20005a1837269f780ca63f16eee49280a88daba /tests
parent9100902d4a6d43537337dceac4697f20c803c9dc (diff)
parent5a324693aa88a4b43eff383fb9d9229afffa6315 (diff)
Merge pull request #6893 from nextcloud/bugfix/6883/check-type-when-verify-if-already-notified
Check type when verify if already notified
Diffstat (limited to 'tests')
-rw-r--r--tests/php/Chat/NotifierTest.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/php/Chat/NotifierTest.php b/tests/php/Chat/NotifierTest.php
index 834c63879..f3fc6df01 100644
--- a/tests/php/Chat/NotifierTest.php
+++ b/tests/php/Chat/NotifierTest.php
@@ -164,6 +164,18 @@ class NotifierTest extends TestCase {
$room = $this->getRoom();
$comment = $this->newComment('108', 'users', 'testUser', new \DateTime('@' . 1000000016), $message);
$notifier = $this->getNotifier([]);
+ $alreadyNotifiedUsers = array_map(function ($user): array {
+ return [
+ 'id' => $user,
+ 'type' => Attendee::ACTOR_USERS,
+ ];
+ }, $alreadyNotifiedUsers);
+ $expectedReturn = array_map(function ($user): array {
+ return [
+ 'id' => $user,
+ 'type' => Attendee::ACTOR_USERS,
+ ];
+ }, $expectedReturn);
$actual = $notifier->notifyMentionedUsers($room, $comment, $alreadyNotifiedUsers);
$this->assertEqualsCanonicalizing($expectedReturn, $actual);
@@ -209,7 +221,8 @@ class NotifierTest extends TestCase {
[Attendee::ACTOR_GROUPS, 'test1', null, Attendee::ACTOR_USERS, 'test1', [], false],
[Attendee::ACTOR_USERS, 'test1', null, Attendee::ACTOR_USERS, 'test1', [], false],
[Attendee::ACTOR_USERS, 'test1', null, Attendee::ACTOR_USERS, 'test2', [], true],
- [Attendee::ACTOR_USERS, 'test1', null, Attendee::ACTOR_USERS, 'test2', ['test1'], false],
+ [Attendee::ACTOR_USERS, 'test1', null, Attendee::ACTOR_USERS, 'test2', [['id' => 'test1', 'type' => Attendee::ACTOR_USERS]], false],
+ [Attendee::ACTOR_USERS, 'test1', null, Attendee::ACTOR_USERS, 'test2', [['id' => 'test1', 'type' => Attendee::ACTOR_FEDERATED_USERS]], true],
[Attendee::ACTOR_USERS, 'test1', Session::SESSION_TIMEOUT - 5, Attendee::ACTOR_USERS, 'test2', [], false],
[Attendee::ACTOR_USERS, 'test1', Session::SESSION_TIMEOUT + 5, Attendee::ACTOR_USERS, 'test2', [], true],
];