aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming/tests
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-11-15 16:02:24 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-11-15 16:02:24 +0100
commit68363f69443e4332b5433a7078cb7fca930a3ebe (patch)
treee78a44d8d7d56f8adb3582714aa03e5b28ae898f /apps/theming/tests
parentc3d0b71f2fc78f4092cf43d642331706fd1f8e7d (diff)
downloadnextcloud-server-68363f69443e4332b5433a7078cb7fca930a3ebe.tar.gz
nextcloud-server-68363f69443e4332b5433a7078cb7fca930a3ebe.zip
Fix some more problems with tests under PHP 8.2
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/theming/tests')
-rw-r--r--apps/theming/tests/Themes/DefaultThemeTest.php4
-rw-r--r--apps/theming/tests/ThemingDefaultsTest.php20
2 files changed, 22 insertions, 2 deletions
diff --git a/apps/theming/tests/Themes/DefaultThemeTest.php b/apps/theming/tests/Themes/DefaultThemeTest.php
index eb9f41d378f..73e5b14683a 100644
--- a/apps/theming/tests/Themes/DefaultThemeTest.php
+++ b/apps/theming/tests/Themes/DefaultThemeTest.php
@@ -22,7 +22,6 @@
*/
namespace OCA\Theming\Tests\Service;
-use OC\App\AppManager;
use OCA\Theming\ImageManager;
use OCA\Theming\ITheme;
use OCA\Theming\Themes\DefaultTheme;
@@ -37,10 +36,11 @@ use OCP\IUserSession;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
-
class DefaultThemeTest extends TestCase {
/** @var ThemingDefaults|MockObject */
private $themingDefaults;
+ /** @var IUserSession|MockObject */
+ private $userSession;
/** @var IURLGenerator|MockObject */
private $urlGenerator;
/** @var ImageManager|MockObject */
diff --git a/apps/theming/tests/ThemingDefaultsTest.php b/apps/theming/tests/ThemingDefaultsTest.php
index d8940670137..c09c7b5f649 100644
--- a/apps/theming/tests/ThemingDefaultsTest.php
+++ b/apps/theming/tests/ThemingDefaultsTest.php
@@ -460,6 +460,11 @@ class ThemingDefaultsTest extends TestCase {
$user->expects($this->any())
->method('getUID')
->willReturn('user');
+ $this->config
+ ->expects($this->at(1))
+ ->method('getAppValue')
+ ->with('theming', 'color')
+ ->willReturn('');
$this->assertEquals(BackgroundService::DEFAULT_COLOR, $this->template->getColorPrimary());
}
@@ -480,6 +485,11 @@ class ThemingDefaultsTest extends TestCase {
->method('getUserValue')
->with('user', 'theming', 'background', '')
->willReturn(array_keys(BackgroundService::SHIPPED_BACKGROUNDS)[$backgroundIndex]);
+ $this->config
+ ->expects($this->at(1))
+ ->method('getAppValue')
+ ->with('theming', 'color')
+ ->willReturn('');
$this->assertEquals($background['primary_color'], $this->template->getColorPrimary());
}
@@ -498,6 +508,11 @@ class ThemingDefaultsTest extends TestCase {
->method('getUserValue')
->with('user', 'theming', 'background', '')
->willReturn('#fff');
+ $this->config
+ ->expects($this->at(1))
+ ->method('getAppValue')
+ ->with('theming', 'color')
+ ->willReturn('');
$this->assertEquals('#fff', $this->template->getColorPrimary());
}
@@ -516,6 +531,11 @@ class ThemingDefaultsTest extends TestCase {
->method('getUserValue')
->with('user', 'theming', 'background', '')
->willReturn('nextcloud');
+ $this->config
+ ->expects($this->at(1))
+ ->method('getAppValue')
+ ->with('theming', 'color')
+ ->willReturn('');
$this->assertEquals($this->template->getDefaultColorPrimary(), $this->template->getColorPrimary());
}