urlGenerator = $this->createMock(IURLGenerator::class); $this->roomManager = $this->createMock(Manager::class); $this->participantService = $this->createMock(ParticipantService::class); $this->chatManager = $this->createMock(ChatManager::class); $this->proxyCacheMessageMapper = $this->createMock(ProxyCacheMessageMapper::class); $this->avatarService = $this->createMock(AvatarService::class); $this->messageParser = $this->createMock(MessageParser::class); $this->l = $this->createMock(IL10N::class); $this->provider = new TalkReferenceProvider( $this->urlGenerator, $this->roomManager, $this->participantService, $this->chatManager, $this->proxyCacheMessageMapper, $this->avatarService, $this->messageParser, $this->l, 'test' ); } public static function dataGetTalkAppLinkToken(): array { return [ ['https://localhost/', null], ['https://localhost/call', null], ['https://localhost/call/abcdef', ['token' => 'abcdef', 'message' => null]], ['https://localhost/call/abcdef?query=1', ['token' => 'abcdef', 'message' => null]], ['https://localhost/call/abcdef#hash=1', ['token' => 'abcdef', 'message' => null]], ['https://localhost/call/abcdef#message_123', ['token' => 'abcdef', 'message' => 123]], ['https://localhost/call/abcdef?query=1#message_123', ['token' => 'abcdef', 'message' => 123]], ['https://localhost/call/abcdef?query=1#message_123bcd', ['token' => 'abcdef', 'message' => null]], ]; } #[DataProvider('dataGetTalkAppLinkToken')] public function testGetTalkAppLinkToken(string $reference, ?array $expected): void { $this->urlGenerator->expects($this->any()) ->method('getAbsoluteURL') ->willReturnCallback(static fn ($url) => 'https://localhost' . $url); $actual = self::invokePrivate($this->provider, 'getTalkAppLinkToken', [$reference]); self::assertSame($expected, $actual); } }