aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming/tests
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-08-27 13:11:30 +0200
committerprovokateurin <kate@provokateurin.de>2024-09-09 11:04:36 +0200
commit0a3093d05da92036684afb5814a4925b443468f7 (patch)
tree89f89e40346d98efc37ecededc55c571e4ec35db /apps/theming/tests
parent669641142b35407ae8b6cce1cda95fdb77747ac9 (diff)
downloadnextcloud-server-0a3093d05da92036684afb5814a4925b443468f7.tar.gz
nextcloud-server-0a3093d05da92036684afb5814a4925b443468f7.zip
fix(theming): Use NavigationManager to handle default entries
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/theming/tests')
-rw-r--r--apps/theming/tests/Controller/ThemingControllerTest.php5
-rw-r--r--apps/theming/tests/Settings/PersonalTest.php15
2 files changed, 13 insertions, 7 deletions
diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php
index 86231e7daf7..fd520231e63 100644
--- a/apps/theming/tests/Controller/ThemingControllerTest.php
+++ b/apps/theming/tests/Controller/ThemingControllerTest.php
@@ -18,6 +18,7 @@ use OCP\Files\NotFoundException;
use OCP\Files\SimpleFS\ISimpleFile;
use OCP\IConfig;
use OCP\IL10N;
+use OCP\INavigationManager;
use OCP\IRequest;
use OCP\IURLGenerator;
use PHPUnit\Framework\MockObject\MockObject;
@@ -42,6 +43,8 @@ class ThemingControllerTest extends TestCase {
private $urlGenerator;
/** @var ThemesService|MockObject */
private $themesService;
+ /** @var INavigationManager|MockObject */
+ private $navigationManager;
protected function setUp(): void {
$this->request = $this->createMock(IRequest::class);
@@ -52,6 +55,7 @@ class ThemingControllerTest extends TestCase {
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->imageManager = $this->createMock(ImageManager::class);
$this->themesService = $this->createMock(ThemesService::class);
+ $this->navigationManager = $this->createMock(INavigationManager::class);
$timeFactory = $this->createMock(ITimeFactory::class);
$timeFactory->expects($this->any())
@@ -70,6 +74,7 @@ class ThemingControllerTest extends TestCase {
$this->appManager,
$this->imageManager,
$this->themesService,
+ $this->navigationManager,
);
parent::setUp();
diff --git a/apps/theming/tests/Settings/PersonalTest.php b/apps/theming/tests/Settings/PersonalTest.php
index 2313b3062a0..88c5e93d1c7 100644
--- a/apps/theming/tests/Settings/PersonalTest.php
+++ b/apps/theming/tests/Settings/PersonalTest.php
@@ -24,6 +24,7 @@ use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\IConfig;
use OCP\IL10N;
+use OCP\INavigationManager;
use OCP\IURLGenerator;
use OCP\IUserSession;
use PHPUnit\Framework\MockObject\MockObject;
@@ -34,7 +35,7 @@ class PersonalTest extends TestCase {
private ThemesService&MockObject $themesService;
private IInitialState&MockObject $initialStateService;
private ThemingDefaults&MockObject $themingDefaults;
- private IAppManager&MockObject $appManager;
+ private INavigationManager&MockObject $navigationManager;
private Personal $admin;
/** @var ITheme[] */
@@ -46,7 +47,7 @@ class PersonalTest extends TestCase {
$this->themesService = $this->createMock(ThemesService::class);
$this->initialStateService = $this->createMock(IInitialState::class);
$this->themingDefaults = $this->createMock(ThemingDefaults::class);
- $this->appManager = $this->createMock(IAppManager::class);
+ $this->navigationManager = $this->createMock(INavigationManager::class);
$this->initThemes();
@@ -62,7 +63,7 @@ class PersonalTest extends TestCase {
$this->themesService,
$this->initialStateService,
$this->themingDefaults,
- $this->appManager,
+ $this->navigationManager,
);
}
@@ -103,9 +104,9 @@ class PersonalTest extends TestCase {
['admin', 'theming', 'background_image', BackgroundService::BACKGROUND_DEFAULT],
]);
- $this->appManager->expects($this->once())
- ->method('getDefaultAppForUser')
- ->willReturn('forcedapp');
+ $this->navigationManager->expects($this->once())
+ ->method('getDefaultEntryIdForUser')
+ ->willReturn('forced_id');
$this->initialStateService->expects($this->exactly(8))
->method('provideInitialState')
@@ -117,7 +118,7 @@ class PersonalTest extends TestCase {
['themes', $themesState],
['enforceTheme', $enforcedTheme],
['isUserThemingDisabled', false],
- ['navigationBar', ['userAppOrder' => [], 'enforcedDefaultApp' => 'forcedapp']],
+ ['navigationBar', ['userAppOrder' => [], 'enforcedDefaultApp' => 'forced_id']],
]);
$expected = new TemplateResponse('theming', 'settings-personal');