|
|
|
|
@ -21,6 +21,8 @@ use OCP\AppFramework\Services\IInitialState; |
|
|
|
|
use OCP\Files\AppData\IAppDataFactory; |
|
|
|
|
use OCP\Http\Client\IClientService; |
|
|
|
|
use OCP\IConfig; |
|
|
|
|
use OCP\IGroup; |
|
|
|
|
use OCP\IGroupManager; |
|
|
|
|
use OCP\IL10N; |
|
|
|
|
use OCP\INavigationManager; |
|
|
|
|
use OCP\IRequest; |
|
|
|
|
@ -45,6 +47,7 @@ class AppSettingsControllerTest extends TestCase { |
|
|
|
|
private CategoryFetcher&MockObject $categoryFetcher; |
|
|
|
|
private AppFetcher&MockObject $appFetcher; |
|
|
|
|
private IFactory&MockObject $l10nFactory; |
|
|
|
|
private IGroupManager&MockObject $groupManager; |
|
|
|
|
private BundleFetcher&MockObject $bundleFetcher; |
|
|
|
|
private Installer&MockObject $installer; |
|
|
|
|
private IURLGenerator&MockObject $urlGenerator; |
|
|
|
|
@ -70,6 +73,7 @@ class AppSettingsControllerTest extends TestCase { |
|
|
|
|
$this->categoryFetcher = $this->createMock(CategoryFetcher::class); |
|
|
|
|
$this->appFetcher = $this->createMock(AppFetcher::class); |
|
|
|
|
$this->l10nFactory = $this->createMock(IFactory::class); |
|
|
|
|
$this->groupManager = $this->createMock(IGroupManager::class); |
|
|
|
|
$this->bundleFetcher = $this->createMock(BundleFetcher::class); |
|
|
|
|
$this->installer = $this->createMock(Installer::class); |
|
|
|
|
$this->urlGenerator = $this->createMock(IURLGenerator::class); |
|
|
|
|
@ -89,6 +93,7 @@ class AppSettingsControllerTest extends TestCase { |
|
|
|
|
$this->categoryFetcher, |
|
|
|
|
$this->appFetcher, |
|
|
|
|
$this->l10nFactory, |
|
|
|
|
$this->groupManager, |
|
|
|
|
$this->bundleFetcher, |
|
|
|
|
$this->installer, |
|
|
|
|
$this->urlGenerator, |
|
|
|
|
@ -168,9 +173,16 @@ class AppSettingsControllerTest extends TestCase { |
|
|
|
|
->expects($this->once()) |
|
|
|
|
->method('setActiveEntry') |
|
|
|
|
->with('core_apps'); |
|
|
|
|
$this->groupManager->expects($this->once()) |
|
|
|
|
->method('search') |
|
|
|
|
->with($this->equalTo(''), $this->equalTo(5)) |
|
|
|
|
->willReturn([ |
|
|
|
|
$this->createMock(IGroup::class), |
|
|
|
|
$this->createMock(IGroup::class), |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
$this->initialState |
|
|
|
|
->expects($this->exactly(3)) |
|
|
|
|
->expects($this->exactly(4)) |
|
|
|
|
->method('provideInitialState'); |
|
|
|
|
|
|
|
|
|
$policy = new ContentSecurityPolicy(); |
|
|
|
|
@ -201,9 +213,16 @@ class AppSettingsControllerTest extends TestCase { |
|
|
|
|
->expects($this->once()) |
|
|
|
|
->method('setActiveEntry') |
|
|
|
|
->with('core_apps'); |
|
|
|
|
$this->groupManager->expects($this->once()) |
|
|
|
|
->method('search') |
|
|
|
|
->with($this->equalTo(''), $this->equalTo(5)) |
|
|
|
|
->willReturn([ |
|
|
|
|
$this->createMock(IGroup::class), |
|
|
|
|
$this->createMock(IGroup::class), |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
$this->initialState |
|
|
|
|
->expects($this->exactly(3)) |
|
|
|
|
->expects($this->exactly(4)) |
|
|
|
|
->method('provideInitialState'); |
|
|
|
|
|
|
|
|
|
$policy = new ContentSecurityPolicy(); |
|
|
|
|
|