public function testAppNavigation() { $this->navigationManager->expects($this->once())->method('add')->willReturnCallback(function ($closure) { $this->assertInstanceOf('\\Closure', $closure); $navigation = $closure(); $this->assertInternalType('array', $navigation); $this->assertCount(5, $navigation); $this->assertSame(['id' => 'announcementcenter', 'order' => 10, 'href' => '/apps/announcementcenter/announcement', 'icon' => '/apps/announcementcenter/img/announcementcenter.svg', 'name' => 'Announcements'], $navigation); }); $this->urlGenerator->expects($this->once())->method('linkToRoute')->with('announcementcenter.page.index')->willReturn('/apps/announcementcenter/announcement'); $this->urlGenerator->expects($this->once())->method('imagePath')->with('announcementcenter', 'announcementcenter.svg')->willReturn('/apps/announcementcenter/img/announcementcenter.svg'); $this->languageFactory->expects($this->once())->method('get')->with('announcementcenter')->willReturn($this->language); include __DIR__ . '/../../appinfo/app.php'; }
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' => 'disabled'], 'user'); $expected->setContentSecurityPolicy($policy); $this->assertEquals($expected, $this->appSettingsController->viewApps('disabled')); }