diff options
Diffstat (limited to 'tests')
5 files changed, 26 insertions, 8 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 1fc24a133..2d78ad37d 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -1554,16 +1554,17 @@ class FeatureContext implements Context, SnippetAcceptingContext { } /** - * @Then /^user "([^"]*)" sees the following shared media in room "([^"]*)" with (\d+)(?: \((v1)\))?$/ + * @Then /^user "([^"]*)" sees the following shared (media|audio|voice|file|deckcard|location|other) in room "([^"]*)" with (\d+)(?: \((v1)\))?$/ * * @param string $user + * @param string $objectType * @param string $identifier * @param string $statusCode * @param string $apiVersion */ - public function userSeesTheFollowingSharedMediaInRoom($user, $identifier, $statusCode, $apiVersion = 'v1', TableNode $formData = null): void { + public function userSeesTheFollowingSharedMediaInRoom($user, $objectType, $identifier, $statusCode, $apiVersion = 'v1', TableNode $formData = null): void { $this->setCurrentUser($user); - $this->sendRequest('GET', '/apps/spreed/api/' . $apiVersion . '/chat/' . self::$identifierToToken[$identifier] . '/share'); + $this->sendRequest('GET', '/apps/spreed/api/' . $apiVersion . '/chat/' . self::$identifierToToken[$identifier] . '/share?objectType=' . $objectType); $this->assertStatusCode($this->response, $statusCode); $this->compareDataResponse($formData); diff --git a/tests/integration/features/chat/rich-object-share.feature b/tests/integration/features/chat/rich-object-share.feature index 3b81ed7ce..467a72501 100644 --- a/tests/integration/features/chat/rich-object-share.feature +++ b/tests/integration/features/chat/rich-object-share.feature @@ -40,8 +40,10 @@ Feature: chat/public | roomType | 3 | | roomName | room | When user "participant1" shares rich-object "call" "R4nd0mT0k3n" '{"name":"Another room","call-type":"group"}' to room "public room" with 201 (v1) - And user "participant1" shares "welcome.txt" with room "public room" with OCS 100 - Then user "participant1" sees the following shared media in room "public room" with 200 + Then user "participant1" sees the following shared other in room "public room" with 200 | room | actorType | actorId | actorDisplayName | message | messageParameters | - | public room | users | participant1 | participant1-displayname | {file} | "IGNORE" | | public room | users | participant1 | participant1-displayname | {object} | {"actor":{"type":"user","id":"participant1","name":"participant1-displayname"},"object":{"name":"Another room","call-type":"group","type":"call","id":"R4nd0mT0k3n"}} | + When user "participant1" shares "welcome.txt" with room "public room" with OCS 100 + Then user "participant1" sees the following shared file in room "public room" with 200 + | room | actorType | actorId | actorDisplayName | message | messageParameters | + | public room | users | participant1 | participant1-displayname | {file} | "IGNORE" | diff --git a/tests/integration/spreedcheats/lib/Controller/ApiController.php b/tests/integration/spreedcheats/lib/Controller/ApiController.php index 13f9753cd..712041f15 100644 --- a/tests/integration/spreedcheats/lib/Controller/ApiController.php +++ b/tests/integration/spreedcheats/lib/Controller/ApiController.php @@ -51,6 +51,9 @@ class ApiController extends OCSController { */ public function resetSpreed(): DataResponse { $delete = $this->db->getQueryBuilder(); + $delete->delete('talk_attachments')->executeStatement(); + + $delete = $this->db->getQueryBuilder(); $delete->delete('talk_attendees')->executeStatement(); $delete = $this->db->getQueryBuilder(); diff --git a/tests/php/Chat/ChatManagerTest.php b/tests/php/Chat/ChatManagerTest.php index 78f9cf693..7145ef8ab 100644 --- a/tests/php/Chat/ChatManagerTest.php +++ b/tests/php/Chat/ChatManagerTest.php @@ -31,6 +31,7 @@ use OCA\Talk\Model\Attendee; use OCA\Talk\Model\AttendeeMapper; use OCA\Talk\Participant; use OCA\Talk\Room; +use OCA\Talk\Service\AttachmentService; use OCA\Talk\Service\ParticipantService; use OCA\Talk\Share\RoomShareProvider; use OCP\AppFramework\Utility\ITimeFactory; @@ -67,6 +68,8 @@ class ChatManagerTest extends TestCase { protected $notifier; /** @var ITimeFactory|MockObject */ protected $timeFactory; + /** @var AttachmentService|MockObject */ + protected $attachmentService; /** @var ChatManager */ protected $chatManager; @@ -81,6 +84,7 @@ class ChatManagerTest extends TestCase { $this->participantService = $this->createMock(ParticipantService::class); $this->notifier = $this->createMock(Notifier::class); $this->timeFactory = $this->createMock(ITimeFactory::class); + $this->attachmentService = $this->createMock(AttachmentService::class); $cacheFactory = $this->createMock(ICacheFactory::class); $this->chatManager = new ChatManager( @@ -93,7 +97,8 @@ class ChatManagerTest extends TestCase { $this->participantService, $this->notifier, $cacheFactory, - $this->timeFactory + $this->timeFactory, + $this->attachmentService ); } @@ -117,6 +122,7 @@ class ChatManagerTest extends TestCase { $this->notifier, $cacheFactory, $this->timeFactory, + $this->attachmentService, ]) ->onlyMethods($methods) ->getMock(); @@ -132,7 +138,8 @@ class ChatManagerTest extends TestCase { $this->participantService, $this->notifier, $cacheFactory, - $this->timeFactory + $this->timeFactory, + $this->attachmentService ); } diff --git a/tests/php/Controller/ChatControllerTest.php b/tests/php/Controller/ChatControllerTest.php index 92473c7fd..ba24bf7f2 100644 --- a/tests/php/Controller/ChatControllerTest.php +++ b/tests/php/Controller/ChatControllerTest.php @@ -33,6 +33,7 @@ use OCA\Talk\Model\Attendee; use OCA\Talk\Model\Message; use OCA\Talk\Participant; use OCA\Talk\Room; +use OCA\Talk\Service\AttachmentService; use OCA\Talk\Service\ParticipantService; use OCA\Talk\Service\SessionService; use OCP\App\IAppManager; @@ -68,6 +69,8 @@ class ChatControllerTest extends TestCase { protected $participantService; /** @var SessionService|MockObject */ protected $sessionService; + /** @var AttachmentService|MockObject */ + protected $attachmentService; /** @var GuestManager|MockObject */ protected $guestManager; /** @var MessageParser|MockObject */ @@ -111,6 +114,7 @@ class ChatControllerTest extends TestCase { $this->chatManager = $this->createMock(ChatManager::class); $this->participantService = $this->createMock(ParticipantService::class); $this->sessionService = $this->createMock(SessionService::class); + $this->attachmentService = $this->createMock(AttachmentService::class); $this->guestManager = $this->createMock(GuestManager::class); $this->messageParser = $this->createMock(MessageParser::class); $this->autoCompleteManager = $this->createMock(IManager::class); @@ -146,6 +150,7 @@ class ChatControllerTest extends TestCase { $this->chatManager, $this->participantService, $this->sessionService, + $this->attachmentService, $this->guestManager, $this->messageParser, $this->autoCompleteManager, |