1818use OCP \IUserManager ;
1919use PHPUnit \Framework \MockObject \MockObject ;
2020use Test \TestCase ;
21+ use Test \FakeAppConfig ;
22+ use Test \FakeFrameworkAppConfig ;
2123
2224class DashboardServiceTest extends TestCase {
2325
2426 private IUserConfig &MockObject $ userConfig ;
25- private IAppConfig & MockObject $ appConfig ;
27+ private IAppConfig $ appConfig ;
2628 private IUserManager &MockObject $ userManager ;
2729 private IAccountManager &MockObject $ accountManager ;
2830 private DashboardService $ service ;
@@ -31,7 +33,7 @@ protected function setUp(): void {
3133 parent ::setUp ();
3234
3335 $ this ->userConfig = $ this ->createMock (IUserConfig::class);
34- $ this ->appConfig = $ this -> createMock (IAppConfig::class );
36+ $ this ->appConfig = new FakeFrameworkAppConfig ( ' dashboard ' );
3537 $ this ->userManager = $ this ->createMock (IUserManager::class);
3638 $ this ->accountManager = $ this ->createMock (IAccountManager::class);
3739
@@ -45,9 +47,6 @@ protected function setUp(): void {
4547 }
4648
4749 public function testGetLayoutRemovesEmptyAndDuplicateEntries (): void {
48- $ this ->appConfig ->method ('getAppValueString ' )
49- ->with ('layout ' , 'recommendations,spreed,mail,calendar ' )
50- ->willReturn ('recommendations,spreed,mail,calendar ' );
5150 $ this ->userConfig ->method ('getValueString ' )
5251 ->with ('alice ' , 'dashboard ' , 'layout ' , 'recommendations,spreed,mail,calendar ' )
5352 ->willReturn ('spreed,,mail,mail,calendar,spreed ' );
0 commit comments