aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/App
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/App')
-rw-r--r--tests/lib/App/AppManagerTest.php54
-rw-r--r--tests/lib/App/PlatformRepositoryTest.php4
2 files changed, 25 insertions, 33 deletions
diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php
index 48d722761bc..5cd141c16a9 100644
--- a/tests/lib/App/AppManagerTest.php
+++ b/tests/lib/App/AppManagerTest.php
@@ -12,6 +12,7 @@ namespace Test\App;
use OC\App\AppManager;
use OC\AppConfig;
+use OC\Config\ConfigManager;
use OCP\App\AppPathNotFoundException;
use OCP\App\Events\AppDisableEvent;
use OCP\App\Events\AppEnableEvent;
@@ -36,10 +37,7 @@ use Test\TestCase;
* @package Test\App
*/
class AppManagerTest extends TestCase {
- /**
- * @return AppConfig|MockObject
- */
- protected function getAppConfig() {
+ protected function getAppConfig(): AppConfig&MockObject {
$appConfig = [];
$config = $this->createMock(AppConfig::class);
@@ -50,7 +48,7 @@ class AppManagerTest extends TestCase {
});
$config->expects($this->any())
->method('setValue')
- ->willReturnCallback(function ($app, $key, $value) use (&$appConfig) {
+ ->willReturnCallback(function ($app, $key, $value) use (&$appConfig): void {
if (!isset($appConfig[$app])) {
$appConfig[$app] = [];
}
@@ -86,33 +84,17 @@ class AppManagerTest extends TestCase {
return $config;
}
- /** @var IUserSession|MockObject */
- protected $userSession;
-
- /** @var IConfig|MockObject */
- private $config;
-
- /** @var IGroupManager|MockObject */
- protected $groupManager;
-
- /** @var AppConfig|MockObject */
- protected $appConfig;
-
- /** @var ICache|MockObject */
- protected $cache;
-
- /** @var ICacheFactory|MockObject */
- protected $cacheFactory;
-
- /** @var IEventDispatcher|MockObject */
- protected $eventDispatcher;
-
- /** @var LoggerInterface|MockObject */
- protected $logger;
-
+ protected IUserSession&MockObject $userSession;
+ private IConfig&MockObject $config;
+ protected IGroupManager&MockObject $groupManager;
+ protected AppConfig&MockObject $appConfig;
+ protected ICache&MockObject $cache;
+ protected ICacheFactory&MockObject $cacheFactory;
+ protected IEventDispatcher&MockObject $eventDispatcher;
+ protected LoggerInterface&MockObject $logger;
protected IURLGenerator&MockObject $urlGenerator;
-
protected ServerVersion&MockObject $serverVersion;
+ protected ConfigManager&MockObject $configManager;
/** @var IAppManager */
protected $manager;
@@ -130,6 +112,7 @@ class AppManagerTest extends TestCase {
$this->logger = $this->createMock(LoggerInterface::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->serverVersion = $this->createMock(ServerVersion::class);
+ $this->configManager = $this->createMock(ConfigManager::class);
$this->overwriteService(AppConfig::class, $this->appConfig);
$this->overwriteService(IURLGenerator::class, $this->urlGenerator);
@@ -152,6 +135,7 @@ class AppManagerTest extends TestCase {
$this->eventDispatcher,
$this->logger,
$this->serverVersion,
+ $this->configManager,
);
}
@@ -171,7 +155,7 @@ class AppManagerTest extends TestCase {
}
public static function dataGetAppIcon(): array {
- $nothing = function ($appId) {
+ $nothing = function ($appId): void {
self::assertEquals('test', $appId);
throw new \RuntimeException();
};
@@ -295,6 +279,7 @@ class AppManagerTest extends TestCase {
$this->eventDispatcher,
$this->logger,
$this->serverVersion,
+ $this->configManager,
])
->onlyMethods([
'getAppPath',
@@ -349,6 +334,7 @@ class AppManagerTest extends TestCase {
$this->eventDispatcher,
$this->logger,
$this->serverVersion,
+ $this->configManager,
])
->onlyMethods([
'getAppPath',
@@ -411,6 +397,7 @@ class AppManagerTest extends TestCase {
$this->eventDispatcher,
$this->logger,
$this->serverVersion,
+ $this->configManager,
])
->onlyMethods([
'getAppPath',
@@ -616,6 +603,7 @@ class AppManagerTest extends TestCase {
$this->eventDispatcher,
$this->logger,
$this->serverVersion,
+ $this->configManager,
])
->onlyMethods(['getAppInfo'])
->getMock();
@@ -676,6 +664,7 @@ class AppManagerTest extends TestCase {
$this->eventDispatcher,
$this->logger,
$this->serverVersion,
+ $this->configManager,
])
->onlyMethods(['getAppInfo'])
->getMock();
@@ -817,6 +806,7 @@ class AppManagerTest extends TestCase {
$this->eventDispatcher,
$this->logger,
$this->serverVersion,
+ $this->configManager,
])
->onlyMethods([
'getAppInfo',
@@ -848,6 +838,7 @@ class AppManagerTest extends TestCase {
$this->eventDispatcher,
$this->logger,
$this->serverVersion,
+ $this->configManager,
])
->onlyMethods([
'getAppInfo',
@@ -878,6 +869,7 @@ class AppManagerTest extends TestCase {
$this->eventDispatcher,
$this->logger,
$this->serverVersion,
+ $this->configManager,
])
->onlyMethods([
'getAppInfo',
diff --git a/tests/lib/App/PlatformRepositoryTest.php b/tests/lib/App/PlatformRepositoryTest.php
index 8f621eebce9..01d49d84832 100644
--- a/tests/lib/App/PlatformRepositoryTest.php
+++ b/tests/lib/App/PlatformRepositoryTest.php
@@ -6,7 +6,7 @@
*/
namespace Test\App;
-use OC;
+use OC\App\PlatformRepository;
class PlatformRepositoryTest extends \Test\TestCase {
/**
@@ -15,7 +15,7 @@ class PlatformRepositoryTest extends \Test\TestCase {
* @param $input
*/
public function testVersion($input, $expected): void {
- $pr = new OC\App\PlatformRepository();
+ $pr = new PlatformRepository();
$normalizedVersion = $pr->normalizeVersion($input);
$this->assertEquals($expected, $normalizedVersion);
}