From fc09daee17b005f04e05643b8aff2ff2ee691baf Mon Sep 17 00:00:00 2001 From: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> Date: Mon, 25 Aug 2025 15:33:49 +0200 Subject: [PATCH] fix(theming): use IAppConfig instead of IConfig to set theming config Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> --- apps/theming/lib/ThemingDefaults.php | 2 +- apps/theming/tests/ThemingDefaultsTest.php | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index 42c96557ba7..855305a9e2e 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -432,7 +432,7 @@ class ThemingDefaults extends \OC_Defaults { * @param string $value */ public function set($setting, $value): void { - $this->config->setAppValue('theming', $setting, $value); + $this->appConfig->setValueString('theming', $setting, $value); $this->increaseCacheBuster(); } diff --git a/apps/theming/tests/ThemingDefaultsTest.php b/apps/theming/tests/ThemingDefaultsTest.php index b8b6c6869cd..d68dac31951 100644 --- a/apps/theming/tests/ThemingDefaultsTest.php +++ b/apps/theming/tests/ThemingDefaultsTest.php @@ -500,18 +500,14 @@ class ThemingDefaultsTest extends TestCase { } public function testSet(): void { - $expectedCalls = [ - ['theming', 'MySetting', 'MyValue'], - ['theming', 'cachebuster', 16], - ]; - $i = 0; $this->config - ->expects($this->exactly(2)) + ->expects($this->once()) ->method('setAppValue') - ->willReturnCallback(function () use ($expectedCalls, &$i): void { - $this->assertEquals($expectedCalls[$i], func_get_args()); - $i++; - }); + ->with('theming', 'cachebuster', 16); + $this->appConfig + ->expects($this->once()) + ->method('setValueString') + ->with('theming', 'MySetting', 'MyValue'); $this->config ->expects($this->once()) ->method('getAppValue')