summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-01-24 16:35:00 +0100
committerGitHub <noreply@github.com>2023-01-24 16:35:00 +0100
commitbfee410ec653a1022e78fc8ce660299ba4529dcf (patch)
tree550b32a53c826cd0182908244de3630b98056eb3 /tests
parentbc863268b420341c0930f65f2c32f91e197ecf8a (diff)
parentcca8617cd70298e205aa3a4f68dc174d73009f15 (diff)
Merge pull request #8550 from nextcloud/feature/notify-recording-stored
Notify recording stored
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/features/callapi/recording.feature3
-rw-r--r--tests/php/Notification/NotifierTest.php9
-rw-r--r--tests/php/Service/RecordingServiceTest.php32
3 files changed, 43 insertions, 1 deletions
diff --git a/tests/integration/features/callapi/recording.feature b/tests/integration/features/callapi/recording.feature
index 37d6cf326..5b4919723 100644
--- a/tests/integration/features/callapi/recording.feature
+++ b/tests/integration/features/callapi/recording.feature
@@ -121,3 +121,6 @@ Feature: callapi/recording
| roomName | room1 |
And user "participant1" joins room "room1" with 200 (v4)
Then user "participant1" store recording file "/img/join_call.ogg" in room "room1" with 200 (v1)
+ And user "participant1" has the following notifications
+ | app | object_type | object_id | subject |
+ | spreed | chat | room1 | Recording for the call in room1 was uploaded. |
diff --git a/tests/php/Notification/NotifierTest.php b/tests/php/Notification/NotifierTest.php
index 6ec9a77c6..7c1b29419 100644
--- a/tests/php/Notification/NotifierTest.php
+++ b/tests/php/Notification/NotifierTest.php
@@ -37,6 +37,7 @@ use OCA\Talk\Room;
use OCA\Talk\Service\ParticipantService;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Comments\IComment;
+use OCP\Files\IRootFolder;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUser;
@@ -73,6 +74,10 @@ class NotifierTest extends TestCase {
protected $commentsManager;
/** @var MessageParser|MockObject */
protected $messageParser;
+ /** @var IURLGenerator|MockObject */
+ protected $urlGenerator;
+ /** @var IRootFolder|MockObject */
+ protected $rootFolder;
/** @var ITimeFactory|MockObject */
protected $timeFactory;
/** @var Definitions|MockObject */
@@ -95,6 +100,8 @@ class NotifierTest extends TestCase {
$this->notificationManager = $this->createMock(INotificationManager::class);
$this->commentsManager = $this->createMock(CommentsManager::class);
$this->messageParser = $this->createMock(MessageParser::class);
+ $this->urlGenerator = $this->createMock(IURLGenerator::class);
+ $this->rootFolder = $this->createMock(IRootFolder::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
$this->definitions = $this->createMock(Definitions::class);
$this->addressHandler = $this->createMock(AddressHandler::class);
@@ -111,6 +118,8 @@ class NotifierTest extends TestCase {
$this->notificationManager,
$this->commentsManager,
$this->messageParser,
+ $this->urlGenerator,
+ $this->rootFolder,
$this->timeFactory,
$this->definitions,
$this->addressHandler
diff --git a/tests/php/Service/RecordingServiceTest.php b/tests/php/Service/RecordingServiceTest.php
index e49147526..998e012b1 100644
--- a/tests/php/Service/RecordingServiceTest.php
+++ b/tests/php/Service/RecordingServiceTest.php
@@ -35,13 +35,19 @@ function is_uploaded_file($filename) {
namespace OCA\Talk\Tests\php\Service;
+use OCA\Talk\Chat\ChatManager;
use OCA\Talk\Config;
+use OCA\Talk\Manager;
use OCA\Talk\Service\ParticipantService;
use OCA\Talk\Service\RecordingService;
use OCA\Talk\Service\RoomService;
+use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Files\IMimeTypeDetector;
use OCP\Files\IRootFolder;
+use OCP\Notification\IManager;
+use OCP\Share\IManager as ShareManager;
use PHPUnit\Framework\MockObject\MockObject;
+use Psr\Log\LoggerInterface;
use Test\TestCase;
class RecordingServiceTest extends TestCase {
@@ -53,8 +59,20 @@ class RecordingServiceTest extends TestCase {
private $rootFolder;
/** @var Config|MockObject */
private $config;
+ /** @var IManager|MockObject */
+ private $notificationManager;
+ /** @var Manager|MockObject */
+ private $roomManager;
+ /** @var ITimeFactory|MockObject */
+ private $timeFactory;
/** @var RoomService|MockObject */
private $roomService;
+ /** @var ShareManager|MockObject */
+ private $shareManager;
+ /** @var ChatManager|MockObject */
+ private $chatManager;
+ /** @var LoggerInterface|MockObject */
+ private $logger;
/** @var RecordingService */
protected $recordingService;
@@ -64,15 +82,27 @@ class RecordingServiceTest extends TestCase {
$this->mimeTypeDetector = \OC::$server->get(IMimeTypeDetector::class);
$this->participantService = $this->createMock(ParticipantService::class);
$this->rootFolder = $this->createMock(IRootFolder::class);
+ $this->notificationManager = $this->createMock(IManager::class);
+ $this->roomManager = $this->createMock(Manager::class);
+ $this->timeFactory = $this->createMock(ITimeFactory::class);
$this->config = $this->createMock(Config::class);
$this->roomService = $this->createMock(RoomService::class);
+ $this->shareManager = $this->createMock(ShareManager::class);
+ $this->chatManager = $this->createMock(ChatManager::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->recordingService = new RecordingService(
$this->mimeTypeDetector,
$this->participantService,
$this->rootFolder,
+ $this->notificationManager,
+ $this->roomManager,
+ $this->timeFactory,
$this->config,
- $this->roomService
+ $this->roomService,
+ $this->shareManager,
+ $this->chatManager,
+ $this->logger,
);
}