1010use OCA \Deck \Db \Board ;
1111use OCA \Deck \Db \Stack ;
1212use OCA \Deck \Service \ConfigService ;
13+ use OCP \IL10N ;
1314use OCP \IRequest ;
1415use Test \TestCase ;
1516
@@ -19,6 +20,7 @@ public function testHasCalendarInCalendarHomeNormalizesAppGeneratedBoardUri(): v
1920 $ backend = $ this ->createMock (DeckCalendarBackend::class);
2021 $ configService = $ this ->createMock (ConfigService::class);
2122 $ request = $ this ->createMock (IRequest::class);
23+ $ l10n = $ this ->createMock (IL10N ::class);
2224
2325 $ configService ->method ('get ' )->with ('calendar ' )->willReturn (true );
2426 $ configService ->method ('getCalDavListMode ' )->willReturn (ConfigService::SETTING_CALDAV_LIST_MODE_ROOT_TASKS );
@@ -31,7 +33,7 @@ public function testHasCalendarInCalendarHomeNormalizesAppGeneratedBoardUri(): v
3133 ->method ('getBoards ' )
3234 ->willReturn ([$ board ]);
3335
34- $ plugin = new CalendarPlugin ($ backend , $ configService , $ request );
36+ $ plugin = new CalendarPlugin ($ backend , $ configService , $ request, $ l10n );
3537
3638 $ this ->assertTrue (
3739 $ plugin ->hasCalendarInCalendarHome ('principals/users/admin ' , 'app-generated--deck--board-2 ' )
@@ -42,6 +44,7 @@ public function testGetCalendarInCalendarHomeNormalizesAppGeneratedStackUri(): v
4244 $ backend = $ this ->createMock (DeckCalendarBackend::class);
4345 $ configService = $ this ->createMock (ConfigService::class);
4446 $ request = $ this ->createMock (IRequest::class);
47+ $ l10n = $ this ->createMock (IL10N ::class);
4548
4649 $ configService ->method ('get ' )->with ('calendar ' )->willReturn (true );
4750 $ configService ->method ('getCalDavListMode ' )->willReturn (ConfigService::SETTING_CALDAV_LIST_MODE_PER_LIST_CALENDAR );
@@ -64,7 +67,7 @@ public function testGetCalendarInCalendarHomeNormalizesAppGeneratedStackUri(): v
6467 ->method ('getBoards ' )
6568 ->willReturn ([$ board ]);
6669
67- $ plugin = new CalendarPlugin ($ backend , $ configService , $ request );
70+ $ plugin = new CalendarPlugin ($ backend , $ configService , $ request, $ l10n );
6871
6972 $ calendar = $ plugin ->getCalendarInCalendarHome ('principals/users/admin ' , 'app-generated--deck--stack-5 ' );
7073
@@ -75,6 +78,7 @@ public function testHasCalendarInCalendarHomeReturnsFalseForDisabledBoardUri():
7578 $ backend = $ this ->createMock (DeckCalendarBackend::class);
7679 $ configService = $ this ->createMock (ConfigService::class);
7780 $ request = $ this ->createMock (IRequest::class);
81+ $ l10n = $ this ->createMock (IL10N ::class);
7882
7983 $ configService ->method ('get ' )->with ('calendar ' )->willReturn (true );
8084 $ configService ->method ('getCalDavListMode ' )->willReturn (ConfigService::SETTING_CALDAV_LIST_MODE_ROOT_TASKS );
@@ -87,7 +91,7 @@ public function testHasCalendarInCalendarHomeReturnsFalseForDisabledBoardUri():
8791 ->method ('getBoards ' )
8892 ->willReturn ([$ board ]);
8993
90- $ plugin = new CalendarPlugin ($ backend , $ configService , $ request );
94+ $ plugin = new CalendarPlugin ($ backend , $ configService , $ request, $ l10n );
9195
9296 $ this ->assertFalse (
9397 $ plugin ->hasCalendarInCalendarHome ('principals/users/admin ' , 'app-generated--deck--board-2 ' )
@@ -98,6 +102,7 @@ public function testGetCalendarInCalendarHomeReturnsNullForDisabledStackBoard():
98102 $ backend = $ this ->createMock (DeckCalendarBackend::class);
99103 $ configService = $ this ->createMock (ConfigService::class);
100104 $ request = $ this ->createMock (IRequest::class);
105+ $ l10n = $ this ->createMock (IL10N ::class);
101106
102107 $ configService ->method ('get ' )->with ('calendar ' )->willReturn (true );
103108 $ configService ->method ('getCalDavListMode ' )->willReturn (ConfigService::SETTING_CALDAV_LIST_MODE_PER_LIST_CALENDAR );
@@ -118,7 +123,7 @@ public function testGetCalendarInCalendarHomeReturnsNullForDisabledStackBoard():
118123 ->with (5 )
119124 ->willReturn ($ stack );
120125
121- $ plugin = new CalendarPlugin ($ backend , $ configService , $ request );
126+ $ plugin = new CalendarPlugin ($ backend , $ configService , $ request, $ l10n );
122127
123128 $ this ->assertNull (
124129 $ plugin ->getCalendarInCalendarHome ('principals/users/admin ' , 'app-generated--deck--stack-5 ' )
0 commit comments