@@ -44,6 +44,25 @@ protected function setUp(): void {
4444 );
4545 }
4646
47+ public function testGetLayoutRemovesEmptyAndDuplicateEntries (): void {
48+ $ this ->appConfig ->method ('getAppValueString ' )
49+ ->with ('layout ' , 'recommendations,spreed,mail,calendar ' )
50+ ->willReturn ('recommendations,spreed,mail,calendar ' );
51+ $ this ->userConfig ->method ('getValueString ' )
52+ ->with ('alice ' , 'dashboard ' , 'layout ' , 'recommendations,spreed,mail,calendar ' )
53+ ->willReturn ('spreed,,mail,mail,calendar,spreed ' );
54+
55+ $ layout = $ this ->service ->getLayout ();
56+
57+ $ this ->assertSame (['spreed ' , 'mail ' , 'calendar ' ], $ layout );
58+ }
59+
60+ public function testSanitizeLayoutRemovesEmptyAndDuplicateEntries (): void {
61+ $ layout = $ this ->service ->sanitizeLayout (['files ' , 'calendar ' , 'files ' , '' , 'mail ' , 'calendar ' ]);
62+
63+ $ this ->assertSame (['files ' , 'calendar ' , 'mail ' ], $ layout );
64+ }
65+
4766 public function testGetBirthdate (): void {
4867 $ user = $ this ->createMock (IUser::class);
4968 $ this ->userManager ->method ('get ' )
0 commit comments