From a9a6d4c1826c7d1c1d11af9af349b67ba5af4923 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 15 Oct 2015 16:15:42 +0200 Subject: Stay on the same category when refreshing the page on the apps list --- .../controller/AppSettingsControllerTest.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/settings/controller/AppSettingsControllerTest.php b/tests/settings/controller/AppSettingsControllerTest.php index d6379deb9c8..62eebc2de50 100644 --- a/tests/settings/controller/AppSettingsControllerTest.php +++ b/tests/settings/controller/AppSettingsControllerTest.php @@ -223,9 +223,28 @@ class AppSettingsControllerTest extends TestCase { $policy = new ContentSecurityPolicy(); $policy->addAllowedImageDomain('https://apps.owncloud.com'); - $expected = new TemplateResponse('settings', 'apps', ['experimentalEnabled' => false], 'user'); + $expected = new TemplateResponse('settings', 'apps', ['experimentalEnabled' => false, 'category' => 0], 'user'); $expected->setContentSecurityPolicy($policy); $this->assertEquals($expected, $this->appSettingsController->viewApps()); } + + public function testViewAppsNotEnabled() { + $this->config + ->expects($this->once()) + ->method('getSystemValue') + ->with('appstore.experimental.enabled', false); + $this->navigationManager + ->expects($this->once()) + ->method('setActiveEntry') + ->with('core_apps'); + + $policy = new ContentSecurityPolicy(); + $policy->addAllowedImageDomain('https://apps.owncloud.com'); + + $expected = new TemplateResponse('settings', 'apps', ['experimentalEnabled' => false, 'category' => 1], 'user'); + $expected->setContentSecurityPolicy($policy); + + $this->assertEquals($expected, $this->appSettingsController->viewApps(1)); + } } -- cgit v1.2.3