1010use OCA \Deck \Db \Board ;
1111use OCA \Deck \Db \Stack ;
1212use OCA \Deck \Service \ConfigService ;
13+ use OCP \IRequest ;
1314use Test \TestCase ;
1415
1516class CalendarPluginTest extends TestCase {
1617
1718 public function testHasCalendarInCalendarHomeNormalizesAppGeneratedBoardUri (): void {
1819 $ backend = $ this ->createMock (DeckCalendarBackend::class);
1920 $ configService = $ this ->createMock (ConfigService::class);
21+ $ request = $ this ->createMock (IRequest::class);
2022
2123 $ configService ->method ('get ' )->with ('calendar ' )->willReturn (true );
2224 $ configService ->method ('getCalDavListMode ' )->willReturn (ConfigService::SETTING_CALDAV_LIST_MODE_ROOT_TASKS );
@@ -29,7 +31,7 @@ public function testHasCalendarInCalendarHomeNormalizesAppGeneratedBoardUri(): v
2931 ->method ('getBoards ' )
3032 ->willReturn ([$ board ]);
3133
32- $ plugin = new CalendarPlugin ($ backend , $ configService );
34+ $ plugin = new CalendarPlugin ($ backend , $ configService, $ request );
3335
3436 $ this ->assertTrue (
3537 $ plugin ->hasCalendarInCalendarHome ('principals/users/admin ' , 'app-generated--deck--board-2 ' )
@@ -39,6 +41,7 @@ public function testHasCalendarInCalendarHomeNormalizesAppGeneratedBoardUri(): v
3941 public function testGetCalendarInCalendarHomeNormalizesAppGeneratedStackUri (): void {
4042 $ backend = $ this ->createMock (DeckCalendarBackend::class);
4143 $ configService = $ this ->createMock (ConfigService::class);
44+ $ request = $ this ->createMock (IRequest::class);
4245
4346 $ configService ->method ('get ' )->with ('calendar ' )->willReturn (true );
4447 $ configService ->method ('getCalDavListMode ' )->willReturn (ConfigService::SETTING_CALDAV_LIST_MODE_PER_LIST_CALENDAR );
@@ -61,7 +64,7 @@ public function testGetCalendarInCalendarHomeNormalizesAppGeneratedStackUri(): v
6164 ->method ('getBoards ' )
6265 ->willReturn ([$ board ]);
6366
64- $ plugin = new CalendarPlugin ($ backend , $ configService );
67+ $ plugin = new CalendarPlugin ($ backend , $ configService, $ request );
6568
6669 $ calendar = $ plugin ->getCalendarInCalendarHome ('principals/users/admin ' , 'app-generated--deck--stack-5 ' );
6770
@@ -71,6 +74,7 @@ public function testGetCalendarInCalendarHomeNormalizesAppGeneratedStackUri(): v
7174 public function testHasCalendarInCalendarHomeReturnsFalseForDisabledBoardUri (): void {
7275 $ backend = $ this ->createMock (DeckCalendarBackend::class);
7376 $ configService = $ this ->createMock (ConfigService::class);
77+ $ request = $ this ->createMock (IRequest::class);
7478
7579 $ configService ->method ('get ' )->with ('calendar ' )->willReturn (true );
7680 $ configService ->method ('getCalDavListMode ' )->willReturn (ConfigService::SETTING_CALDAV_LIST_MODE_ROOT_TASKS );
@@ -83,7 +87,7 @@ public function testHasCalendarInCalendarHomeReturnsFalseForDisabledBoardUri():
8387 ->method ('getBoards ' )
8488 ->willReturn ([$ board ]);
8589
86- $ plugin = new CalendarPlugin ($ backend , $ configService );
90+ $ plugin = new CalendarPlugin ($ backend , $ configService, $ request );
8791
8892 $ this ->assertFalse (
8993 $ plugin ->hasCalendarInCalendarHome ('principals/users/admin ' , 'app-generated--deck--board-2 ' )
@@ -93,6 +97,7 @@ public function testHasCalendarInCalendarHomeReturnsFalseForDisabledBoardUri():
9397 public function testGetCalendarInCalendarHomeReturnsNullForDisabledStackBoard (): void {
9498 $ backend = $ this ->createMock (DeckCalendarBackend::class);
9599 $ configService = $ this ->createMock (ConfigService::class);
100+ $ request = $ this ->createMock (IRequest::class);
96101
97102 $ configService ->method ('get ' )->with ('calendar ' )->willReturn (true );
98103 $ configService ->method ('getCalDavListMode ' )->willReturn (ConfigService::SETTING_CALDAV_LIST_MODE_PER_LIST_CALENDAR );
@@ -113,7 +118,7 @@ public function testGetCalendarInCalendarHomeReturnsNullForDisabledStackBoard():
113118 ->with (5 )
114119 ->willReturn ($ stack );
115120
116- $ plugin = new CalendarPlugin ($ backend , $ configService );
121+ $ plugin = new CalendarPlugin ($ backend , $ configService, $ request );
117122
118123 $ this ->assertNull (
119124 $ plugin ->getCalendarInCalendarHome ('principals/users/admin ' , 'app-generated--deck--stack-5 ' )
0 commit comments