1818use OCP \Search \ISearchQuery ;
1919use OCP \Search \SearchResult ;
2020use OCP \Search \SearchResultEntry ;
21+ use PHPUnit \Framework \Attributes \DataProvider ;
2122use PHPUnit \Framework \MockObject \MockObject ;
2223use Sabre \VObject \Reader ;
2324use Test \TestCase ;
@@ -399,7 +400,18 @@ public function testSearch(): void {
399400 $ this ->assertFalse ($ result2Data ['rounded ' ]);
400401 }
401402
402- public function testGetDeepLinkToCalendarApp (): void {
403+ public static function provideDeepLinkData (): array {
404+ return [
405+ ['principals/users/john.doe ' , 'bGluay10by1yZW1vdGUucGhwL2Rhdi9jYWxlbmRhcnMvam9obi5kb2UvZm9vL2Jhci5pY3M= ' ],
406+ ['principals/users/John Doe ' , 'bGluay10by1yZW1vdGUucGhwL2Rhdi9jYWxlbmRhcnMvSm9obiUyMERvZS9mb28vYmFyLmljcw== ' ],
407+ ];
408+ }
409+
410+ #[DataProvider('provideDeepLinkData ' )]
411+ public function testGetDeepLinkToCalendarApp (
412+ string $ principalUri ,
413+ string $ expectedBase64DavUrl ,
414+ ): void {
403415 $ this ->urlGenerator ->expects ($ this ->once ())
404416 ->method ('linkTo ' )
405417 ->with ('' , 'remote.php ' )
@@ -410,10 +422,14 @@ public function testGetDeepLinkToCalendarApp(): void {
410422 ->willReturn ('link-to-route-calendar/ ' );
411423 $ this ->urlGenerator ->expects ($ this ->once ())
412424 ->method ('getAbsoluteURL ' )
413- ->with (' link-to-route-calendar/edit/bGluay10by1yZW1vdGUucGhwL2Rhdi9jYWxlbmRhcnMvam9obi5kb2UvZm9vL2Jhci5pY3M= ' )
425+ ->with (" link-to-route-calendar/edit/ $ expectedBase64DavUrl " )
414426 ->willReturn ('absolute-url-to-route ' );
415427
416- $ actual = self ::invokePrivate ($ this ->provider , 'getDeepLinkToCalendarApp ' , ['principals/users/john.doe ' , 'foo ' , 'bar.ics ' ]);
428+ $ actual = self ::invokePrivate ($ this ->provider , 'getDeepLinkToCalendarApp ' , [
429+ $ principalUri ,
430+ 'foo ' ,
431+ 'bar.ics ' ,
432+ ]);
417433
418434 $ this ->assertEquals ('absolute-url-to-route ' , $ actual );
419435 }
0 commit comments