diff options
author | Gary Kim <gary@garykim.dev> | 2021-08-28 00:20:37 +0300 |
---|---|---|
committer | Gary Kim <gary@garykim.dev> | 2021-09-21 19:00:11 +0300 |
commit | abbe54696315d1f5b778d4cf3176a23f3a162986 (patch) | |
tree | dc5c1eeef5f227e60a227fc4ea080d4b6c1d60f2 /tests | |
parent | a3cd8312a28942cda4260892f442834d41d66e54 (diff) |
Review fixes
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/php/Federation/FederationTest.php | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/tests/php/Federation/FederationTest.php b/tests/php/Federation/FederationTest.php index d248b1d41..d5376e1c1 100644 --- a/tests/php/Federation/FederationTest.php +++ b/tests/php/Federation/FederationTest.php @@ -28,10 +28,8 @@ use OCA\Talk\Federation\CloudFederationProviderTalk; use OCA\Talk\Federation\FederationManager; use OCA\Talk\Federation\Notifications; use OCA\Talk\Manager; -use OCA\Talk\MatterbridgeManager; use OCA\Talk\Model\Attendee; use OCA\Talk\Model\AttendeeMapper; -use OCA\Talk\Participant; use OCA\Talk\Room; use OCA\Talk\Service\ParticipantService; use OCP\BackgroundJob\IJobList; @@ -91,8 +89,6 @@ class FederationTest extends TestCase { $this->cloudFederationProviderManager, $this->createMock(IJobList::class), $this->userManager, - $this->attendeeMapper, - $this->createMock(MatterbridgeManager::class), ); $this->federationManager = $this->createMock(FederationManager::class); @@ -128,7 +124,7 @@ class FederationTest extends TestCase { $roomName = 'Room name'; $room = $this->createMock(Room::class); - $attendee = $this->createMock(Attendee::class); + $attendee = $this->createStub(Attendee::class); $ownerUser = $this->createMock(IUser::class); $room->expects($this->once()) @@ -146,29 +142,8 @@ class FederationTest extends TestCase { ->with() ->willReturn($name); - $room->expects($this->once()) - ->method('getId') - ->with() - ->willReturn($roomId); - - $attendee->expects($this->once()) - ->method('getActorType') - ->with() - ->willReturn(Attendee::ACTOR_USERS); - - $attendee->expects($this->once()) - ->method('getActorId') - ->with() - ->willReturn($ownerId); - - $this->attendeeMapper->expects($this->once()) - ->method('getActorsByParticipantTypes') - ->with($roomId, [Participant::OWNER]) - ->willReturn([$attendee]); - $this->userManager->expects($this->once()) ->method('get') - ->with($ownerId) ->willReturn($ownerUser); $ownerUser->expects($this->once()) @@ -207,7 +182,7 @@ class FederationTest extends TestCase { ->with($shareWith) ->willReturn(['test', 'remote.test.local']); - $this->notifications->sendRemoteShare($providerId, $token, $shareWith, $sharedBy, $sharedByFederatedId, $shareType, $room); + $this->notifications->sendRemoteShare($providerId, $token, $shareWith, $sharedBy, $sharedByFederatedId, $shareType, $room, $attendee); } public function testReceiveRemoteShare() { |