diff options
author | Joas Schilling <coding@schilljs.com> | 2022-07-22 11:02:37 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-07-22 11:02:37 +0200 |
commit | 9a9db2802b56d63137122bfaf97da2cc8e11bc7d (patch) | |
tree | 49ad24aad42b4b1f68f77940eb3b2096140c8f86 /apps/user_status/tests/Unit | |
parent | 7e05efd3529f39bf5480fd2d954d04b9c49ca301 (diff) | |
download | nextcloud-server-9a9db2802b56d63137122bfaf97da2cc8e11bc7d.tar.gz nextcloud-server-9a9db2802b56d63137122bfaf97da2cc8e11bc7d.zip |
Reset user status based on message ID only
Since some statuses (call) can occure with different status
(away and dnd) we need to reset only based on the message id.
But as it can not be set by the user this is still save and okay.
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/user_status/tests/Unit')
-rw-r--r-- | apps/user_status/tests/Unit/Service/StatusServiceTest.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/user_status/tests/Unit/Service/StatusServiceTest.php b/apps/user_status/tests/Unit/Service/StatusServiceTest.php index df31cf0d5ad..413cecce595 100644 --- a/apps/user_status/tests/Unit/Service/StatusServiceTest.php +++ b/apps/user_status/tests/Unit/Service/StatusServiceTest.php @@ -795,24 +795,34 @@ class StatusServiceTest extends TestCase { $backupOnly->setUserId('_backuponly'); $backupOnly->setIsBackup(true); + $noBackupDND = new UserStatus(); + $noBackupDND->setId(5); + $noBackupDND->setStatus(IUserStatus::DND); + $noBackupDND->setStatusTimestamp(1337); + $noBackupDND->setIsUserDefined(false); + $noBackupDND->setMessageId('call'); + $noBackupDND->setUserId('nobackupanddnd'); + $noBackupDND->setIsBackup(false); + $this->mapper->expects($this->once()) ->method('findByUserIds') - ->with(['john', 'nobackup', 'backuponly', '_john', '_nobackup', '_backuponly']) + ->with(['john', 'nobackup', 'backuponly', 'nobackupanddnd', '_john', '_nobackup', '_backuponly', '_nobackupanddnd']) ->willReturn([ $john, $johnBackup, $noBackup, $backupOnly, + $noBackupDND, ]); $this->mapper->expects($this->once()) ->method('deleteByIds') - ->with([1, 3]); + ->with([1, 3, 5]); $this->mapper->expects($this->once()) ->method('restoreBackupStatuses') ->with([2]); - $this->service->revertMultipleUserStatus(['john', 'nobackup', 'backuponly'], 'call', IUserStatus::AWAY); + $this->service->revertMultipleUserStatus(['john', 'nobackup', 'backuponly', 'nobackupanddnd'], 'call'); } } |