summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-03-21 11:17:14 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-03-24 16:21:26 +0100
commit61f7f13bd81948f6179bb8f70b6711c002ddd70e (patch)
treef1238dd97d93203637bb203d4cf649b65c8fbc4a /tests
parente8c1f75064ae008e50daa087924de5d29368747e (diff)
downloadnextcloud-server-61f7f13bd81948f6179bb8f70b6711c002ddd70e.tar.gz
nextcloud-server-61f7f13bd81948f6179bb8f70b6711c002ddd70e.zip
Migrate from ILogger to LoggerInterface where needed in the tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php6
-rw-r--r--tests/lib/AppFramework/Routing/RoutingTest.php14
-rw-r--r--tests/lib/DB/QueryBuilder/QueryBuilderTest.php32
-rw-r--r--tests/lib/Encryption/EncryptionWrapperTest.php7
-rw-r--r--tests/lib/Encryption/ManagerTest.php6
-rw-r--r--tests/lib/EventDispatcher/SymfonyAdapterTest.php6
-rw-r--r--tests/lib/Files/Config/UserMountCacheTest.php4
-rw-r--r--tests/lib/Files/EtagTest.php3
-rw-r--r--tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php6
-rw-r--r--tests/lib/Files/Node/HookConnectorTest.php4
-rw-r--r--tests/lib/Files/Node/IntegrationTest.php4
-rw-r--r--tests/lib/Files/Node/NodeTest.php6
-rw-r--r--tests/lib/Files/Node/RootTest.php6
-rw-r--r--tests/lib/Files/Storage/Wrapper/EncryptionTest.php13
-rw-r--r--tests/lib/Files/Type/DetectionTest.php8
-rw-r--r--tests/lib/Files/Utils/ScannerTest.php13
-rw-r--r--tests/lib/Group/ManagerTest.php6
-rw-r--r--tests/lib/Http/Client/ClientServiceTest.php4
-rw-r--r--tests/lib/Http/Client/ClientTest.php11
-rw-r--r--tests/lib/Http/Client/LocalAddressCheckerTest.php4
-rw-r--r--tests/lib/Lock/DBLockingProviderTest.php3
-rw-r--r--tests/lib/Lock/NonCachingDBLockingProviderTest.php3
-rw-r--r--tests/lib/Mail/MailerTest.php6
-rw-r--r--tests/lib/Memcache/FactoryTest.php6
-rw-r--r--tests/lib/Route/RouterTest.php6
-rw-r--r--tests/lib/Security/Bruteforce/ThrottlerTest.php6
-rw-r--r--tests/lib/Security/CertificateManagerTest.php6
-rw-r--r--tests/lib/Security/IdentityProof/ManagerTest.php6
-rw-r--r--tests/lib/Share20/ManagerTest.php6
-rw-r--r--tests/lib/TempManagerTest.php4
-rw-r--r--tests/lib/Template/CSSResourceLocatorTest.php6
-rw-r--r--tests/lib/Template/IconsCacherTest.php10
-rw-r--r--tests/lib/Template/JSCombinerTest.php6
-rw-r--r--tests/lib/Template/JSResourceLocatorTest.php6
-rw-r--r--tests/lib/Template/ResourceLocatorTest.php4
-rw-r--r--tests/lib/Template/SCSSCacherTest.php6
-rw-r--r--tests/lib/Traits/EncryptionTrait.php3
-rw-r--r--tests/lib/Updater/ChangesCheckTest.php6
-rw-r--r--tests/lib/User/SessionTest.php6
39 files changed, 131 insertions, 137 deletions
diff --git a/tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php b/tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php
index a487e021187..8ecef60c35d 100644
--- a/tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php
+++ b/tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php
@@ -29,15 +29,15 @@ use OCP\Files\Folder;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
-use OCP\ILogger;
use OCP\IUserManager;
+use Psr\Log\LoggerInterface;
use Test\TestCase;
class CleanPreviewsBackgroundJobTest extends TestCase {
/** @var IRootFolder|\PHPUnit_Framework_MockObject_MockObject */
private $rootFolder;
- /** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */
private $logger;
/** @var IJobList|\PHPUnit_Framework_MockObject_MockObject */
@@ -56,7 +56,7 @@ class CleanPreviewsBackgroundJobTest extends TestCase {
parent::setUp();
$this->rootFolder = $this->createMock(IRootFolder::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->jobList = $this->createMock(IJobList::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
$this->userManager = $this->createMock(IUserManager::class);
diff --git a/tests/lib/AppFramework/Routing/RoutingTest.php b/tests/lib/AppFramework/Routing/RoutingTest.php
index c53c251ea2d..b4965d61d4f 100644
--- a/tests/lib/AppFramework/Routing/RoutingTest.php
+++ b/tests/lib/AppFramework/Routing/RoutingTest.php
@@ -6,9 +6,9 @@ use OC\AppFramework\DependencyInjection\DIContainer;
use OC\AppFramework\Routing\RouteConfig;
use OC\Route\Route;
use OC\Route\Router;
-use OCP\ILogger;
use OCP\Route\IRouter;
use PHPUnit\Framework\MockObject\MockObject;
+use Psr\Log\LoggerInterface;
class RoutingTest extends \Test\TestCase {
public function testSimpleRoute() {
@@ -133,7 +133,7 @@ class RoutingTest extends \Test\TestCase {
/** @var IRouter|MockObject $router */
$router = $this->getMockBuilder(Router::class)
->onlyMethods(['create'])
- ->setConstructorArgs([$this->createMock(ILogger::class)])
+ ->setConstructorArgs([$this->createMock(LoggerInterface::class)])
->getMock();
// load route configuration
@@ -154,7 +154,7 @@ class RoutingTest extends \Test\TestCase {
/** @var IRouter|MockObject $router */
$router = $this->getMockBuilder(Router::class)
->onlyMethods(['create'])
- ->setConstructorArgs([$this->createMock(ILogger::class)])
+ ->setConstructorArgs([$this->createMock(LoggerInterface::class)])
->getMock();
// load route configuration
@@ -214,7 +214,7 @@ class RoutingTest extends \Test\TestCase {
/** @var IRouter|MockObject $router */
$router = $this->getMockBuilder(Router::class)
->onlyMethods(['create'])
- ->setConstructorArgs([$this->createMock(ILogger::class)])
+ ->setConstructorArgs([$this->createMock(LoggerInterface::class)])
->getMock();
// we expect create to be called once:
@@ -264,7 +264,7 @@ class RoutingTest extends \Test\TestCase {
/** @var IRouter|MockObject $router */
$router = $this->getMockBuilder(Router::class)
->onlyMethods(['create'])
- ->setConstructorArgs([$this->createMock(ILogger::class)])
+ ->setConstructorArgs([$this->createMock(LoggerInterface::class)])
->getMock();
// we expect create to be called once:
@@ -291,7 +291,7 @@ class RoutingTest extends \Test\TestCase {
/** @var IRouter|MockObject $router */
$router = $this->getMockBuilder(Router::class)
->onlyMethods(['create'])
- ->setConstructorArgs([$this->createMock(ILogger::class)])
+ ->setConstructorArgs([$this->createMock(LoggerInterface::class)])
->getMock();
// route mocks
@@ -351,7 +351,7 @@ class RoutingTest extends \Test\TestCase {
/** @var IRouter|MockObject $router */
$router = $this->getMockBuilder(Router::class)
->onlyMethods(['create'])
- ->setConstructorArgs([$this->createMock(ILogger::class)])
+ ->setConstructorArgs([$this->createMock(LoggerInterface::class)])
->getMock();
// route mocks
diff --git a/tests/lib/DB/QueryBuilder/QueryBuilderTest.php b/tests/lib/DB/QueryBuilder/QueryBuilderTest.php
index fab080eec86..6e9a7a84925 100644
--- a/tests/lib/DB/QueryBuilder/QueryBuilderTest.php
+++ b/tests/lib/DB/QueryBuilder/QueryBuilderTest.php
@@ -30,7 +30,7 @@ use OC\DB\QueryBuilder\QueryBuilder;
use OC\SystemConfig;
use OCP\DB\QueryBuilder\IQueryFunction;
use OCP\IDBConnection;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
/**
* Class QueryBuilderTest
@@ -49,7 +49,7 @@ class QueryBuilderTest extends \Test\TestCase {
/** @var SystemConfig|\PHPUnit\Framework\MockObject\MockObject */
protected $config;
- /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
protected $logger;
protected function setUp(): void {
@@ -57,7 +57,7 @@ class QueryBuilderTest extends \Test\TestCase {
$this->connection = \OC::$server->getDatabaseConnection();
$this->config = $this->createMock(SystemConfig::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->queryBuilder = new QueryBuilder($this->connection, $this->config, $this->logger);
}
@@ -176,7 +176,7 @@ class QueryBuilderTest extends \Test\TestCase {
public function dataSelect() {
$config = $this->createMock(SystemConfig::class);
- $logger = $this->createMock(ILogger::class);
+ $logger = $this->createMock(LoggerInterface::class);
$queryBuilder = new QueryBuilder(\OC::$server->getDatabaseConnection(), $config, $logger);
return [
// select('column1')
@@ -244,7 +244,7 @@ class QueryBuilderTest extends \Test\TestCase {
public function dataSelectAlias() {
$config = $this->createMock(SystemConfig::class);
- $logger = $this->createMock(ILogger::class);
+ $logger = $this->createMock(LoggerInterface::class);
$queryBuilder = new QueryBuilder(\OC::$server->getDatabaseConnection(), $config, $logger);
return [
['configvalue', 'cv', ['cv' => '99']],
@@ -353,7 +353,7 @@ class QueryBuilderTest extends \Test\TestCase {
public function dataAddSelect() {
$config = $this->createMock(SystemConfig::class);
- $logger = $this->createMock(ILogger::class);
+ $logger = $this->createMock(LoggerInterface::class);
$queryBuilder = new QueryBuilder(\OC::$server->getDatabaseConnection(), $config, $logger);
return [
// addSelect('column1')
@@ -508,7 +508,7 @@ class QueryBuilderTest extends \Test\TestCase {
public function dataFrom() {
$config = $this->createMock(SystemConfig::class);
- $logger = $this->createMock(ILogger::class);
+ $logger = $this->createMock(LoggerInterface::class);
$qb = new QueryBuilder(\OC::$server->getDatabaseConnection(), $config, $logger);
return [
[$qb->createFunction('(' . $qb->select('*')->from('test')->getSQL() . ')'), 'q', null, null, [
@@ -1212,7 +1212,7 @@ class QueryBuilderTest extends \Test\TestCase {
public function dataGetTableName() {
$config = $this->createMock(SystemConfig::class);
- $logger = $this->createMock(ILogger::class);
+ $logger = $this->createMock(LoggerInterface::class);
$qb = new QueryBuilder(\OC::$server->getDatabaseConnection(), $config, $logger);
return [
['*PREFIX*table', null, '`*PREFIX*table`'],
@@ -1414,12 +1414,12 @@ class QueryBuilderTest extends \Test\TestCase {
->willReturn($this->createMock(Result::class));
$this->logger
->expects($this->once())
- ->method('logException')
- ->willReturnCallback(function ($e, $parameters) {
- $this->assertInstanceOf(QueryException::class, $e);
+ ->method('error')
+ ->willReturnCallback(function ($message, $parameters) {
+ $this->assertInstanceOf(QueryException::class, $parameters['exception']);
$this->assertSame(
'More than 1000 expressions in a list are not allowed on Oracle.',
- $parameters['message']
+ $message
);
});
$this->config
@@ -1449,12 +1449,12 @@ class QueryBuilderTest extends \Test\TestCase {
->willReturn($this->createMock(Result::class));
$this->logger
->expects($this->once())
- ->method('logException')
- ->willReturnCallback(function ($e, $parameters) {
- $this->assertInstanceOf(QueryException::class, $e);
+ ->method('error')
+ ->willReturnCallback(function ($message, $parameters) {
+ $this->assertInstanceOf(QueryException::class, $parameters['exception']);
$this->assertSame(
'The number of parameters must not exceed 65535. Restriction by PostgreSQL.',
- $parameters['message']
+ $message
);
});
$this->config
diff --git a/tests/lib/Encryption/EncryptionWrapperTest.php b/tests/lib/Encryption/EncryptionWrapperTest.php
index 20bcb6e7ca1..5d707ca6ec6 100644
--- a/tests/lib/Encryption/EncryptionWrapperTest.php
+++ b/tests/lib/Encryption/EncryptionWrapperTest.php
@@ -25,7 +25,7 @@ use OC\Encryption\EncryptionWrapper;
use OC\Encryption\Manager;
use OC\Memcache\ArrayCache;
use OCP\Files\Storage;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
use Test\TestCase;
class EncryptionWrapperTest extends TestCase {
@@ -33,7 +33,7 @@ class EncryptionWrapperTest extends TestCase {
/** @var EncryptionWrapper */
private $instance;
- /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\ILogger */
+ /** @var \PHPUnit\Framework\MockObject\MockObject | LoggerInterface */
private $logger;
/** @var \PHPUnit\Framework\MockObject\MockObject | \OC\Encryption\Manager */
@@ -47,8 +47,7 @@ class EncryptionWrapperTest extends TestCase {
$this->arrayCache = $this->createMock(ArrayCache::class);
$this->manager = $this->createMock(Manager::class);
- $this->logger = $this->createMock(ILogger::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->instance = new EncryptionWrapper($this->arrayCache, $this->manager, $this->logger);
}
diff --git a/tests/lib/Encryption/ManagerTest.php b/tests/lib/Encryption/ManagerTest.php
index 81ac263cb93..00448db87d6 100644
--- a/tests/lib/Encryption/ManagerTest.php
+++ b/tests/lib/Encryption/ManagerTest.php
@@ -9,7 +9,7 @@ use OC\Memcache\ArrayCache;
use OCP\Encryption\IEncryptionModule;
use OCP\IConfig;
use OCP\IL10N;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
use Test\TestCase;
class ManagerTest extends TestCase {
@@ -20,7 +20,7 @@ class ManagerTest extends TestCase {
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
private $config;
- /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
private $logger;
/** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
@@ -38,7 +38,7 @@ class ManagerTest extends TestCase {
protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->l10n = $this->createMock(IL10N::class);
$this->view = $this->createMock(View::class);
$this->util = $this->createMock(Util::class);
diff --git a/tests/lib/EventDispatcher/SymfonyAdapterTest.php b/tests/lib/EventDispatcher/SymfonyAdapterTest.php
index 5e2803624af..785b4bfdfcb 100644
--- a/tests/lib/EventDispatcher/SymfonyAdapterTest.php
+++ b/tests/lib/EventDispatcher/SymfonyAdapterTest.php
@@ -30,8 +30,8 @@ use OC\EventDispatcher\GenericEventWrapper;
use OC\EventDispatcher\SymfonyAdapter;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\GenericEvent;
-use OCP\ILogger;
use PHPUnit\Framework\MockObject\MockObject;
+use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\Event as SymfonyEvent;
use Symfony\Component\EventDispatcher\EventDispatcher as SymfonyDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -43,7 +43,7 @@ class SymfonyAdapterTest extends TestCase {
/** @var EventDispatcher|MockObject */
private $eventDispatcher;
- /** @var ILogger|MockObject */
+ /** @var LoggerInterface|MockObject */
private $logger;
/** @var EventDispatcherInterface */
@@ -53,7 +53,7 @@ class SymfonyAdapterTest extends TestCase {
parent::setUp();
$this->eventDispatcher = $this->createMock(EventDispatcher::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->adapter = new SymfonyAdapter(
$this->eventDispatcher,
diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php
index 0922dab3672..f4c6a427abd 100644
--- a/tests/lib/Files/Config/UserMountCacheTest.php
+++ b/tests/lib/Files/Config/UserMountCacheTest.php
@@ -11,7 +11,6 @@ namespace Test\Files\Config;
use OC\DB\QueryBuilder\Literal;
use OC\Files\Mount\MountPoint;
use OC\Files\Storage\Storage;
-use OC\Log;
use OC\User\Manager;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Config\ICachedMountInfo;
@@ -19,6 +18,7 @@ use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\IUserManager;
+use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\TestCase;
use Test\Util\User\Dummy;
@@ -66,7 +66,7 @@ class UserMountCacheTest extends TestCase {
$userBackend->createUser('u2', '');
$userBackend->createUser('u3', '');
$this->userManager->registerBackend($userBackend);
- $this->cache = new \OC\Files\Config\UserMountCache($this->connection, $this->userManager, $this->createMock(Log::class));
+ $this->cache = new \OC\Files\Config\UserMountCache($this->connection, $this->userManager, $this->createMock(LoggerInterface::class));
}
protected function tearDown(): void {
diff --git a/tests/lib/Files/EtagTest.php b/tests/lib/Files/EtagTest.php
index 39069ce4dfe..43b92c12391 100644
--- a/tests/lib/Files/EtagTest.php
+++ b/tests/lib/Files/EtagTest.php
@@ -11,6 +11,7 @@ namespace Test\Files;
use OC\Files\Filesystem;
use OCP\EventDispatcher\IEventDispatcher;
use OCA\Files_Sharing\AppInfo\Application;
+use Psr\Log\LoggerInterface;
/**
* Class EtagTest
@@ -69,7 +70,7 @@ class EtagTest extends \Test\TestCase {
$files = ['/foo.txt', '/folder/bar.txt', '/folder/subfolder', '/folder/subfolder/qwerty.txt'];
$originalEtags = $this->getEtags($files);
- $scanner = new \OC\Files\Utils\Scanner($user1, \OC::$server->getDatabaseConnection(), \OC::$server->query(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new \OC\Files\Utils\Scanner($user1, \OC::$server->getDatabaseConnection(), \OC::$server->query(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$scanner->backgroundScan('/');
$newEtags = $this->getEtags($files);
diff --git a/tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php b/tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php
index 400808d7cd5..ef2ede729ce 100644
--- a/tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php
+++ b/tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php
@@ -30,8 +30,8 @@ use OC\Files\ObjectStore\S3;
use OC\Files\Storage\StorageFactory;
use OCP\Files\Storage\IStorageFactory;
use OCP\IConfig;
-use OCP\ILogger;
use PHPUnit\Framework\MockObject\MockObject;
+use Psr\Log\LoggerInterface;
/**
* @group DB
@@ -43,7 +43,7 @@ class ObjectStorePreviewCacheMountProviderTest extends \Test\TestCase {
/** @var ObjectStorePreviewCacheMountProvider */
protected $provider;
- /** @var ILogger|MockObject */
+ /** @var LoggerInterface|MockObject */
protected $logger;
/** @var IConfig|MockObject */
protected $config;
@@ -54,7 +54,7 @@ class ObjectStorePreviewCacheMountProviderTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->config = $this->createMock(IConfig::class);
$this->loader = $this->createMock(StorageFactory::class);
diff --git a/tests/lib/Files/Node/HookConnectorTest.php b/tests/lib/Files/Node/HookConnectorTest.php
index 5e0b4017243..f99db6599fd 100644
--- a/tests/lib/Files/Node/HookConnectorTest.php
+++ b/tests/lib/Files/Node/HookConnectorTest.php
@@ -30,9 +30,9 @@ use OCP\Files\Events\Node\NodeRenamedEvent;
use OCP\Files\Events\Node\NodeTouchedEvent;
use OCP\Files\Events\Node\NodeWrittenEvent;
use OCP\Files\Node;
-use OCP\ILogger;
use OCP\IUserManager;
use PHPUnit\Framework\MockObject\MockObject;
+use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
use Test\TestCase;
@@ -77,7 +77,7 @@ class HookConnectorTest extends TestCase {
$this->view,
\OC::$server->getUserManager()->get($this->userId),
\OC::$server->getUserMountCache(),
- $this->createMock(ILogger::class),
+ $this->createMock(LoggerInterface::class),
$this->createMock(IUserManager::class),
$this->createMock(IEventDispatcher::class)
);
diff --git a/tests/lib/Files/Node/IntegrationTest.php b/tests/lib/Files/Node/IntegrationTest.php
index 71e8793ad6f..5ef5a134e1b 100644
--- a/tests/lib/Files/Node/IntegrationTest.php
+++ b/tests/lib/Files/Node/IntegrationTest.php
@@ -13,8 +13,8 @@ use OC\Files\Storage\Temporary;
use OC\Files\View;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Mount\IMountManager;
-use OCP\ILogger;
use OCP\IUserManager;
+use Psr\Log\LoggerInterface;
use Test\Traits\UserTrait;
/**
@@ -59,7 +59,7 @@ class IntegrationTest extends \Test\TestCase {
$this->view,
$user,
\OC::$server->getUserMountCache(),
- $this->createMock(ILogger::class),
+ $this->createMock(LoggerInterface::class),
$this->createMock(IUserManager::class),
$this->createMock(IEventDispatcher::class)
);
diff --git a/tests/lib/Files/Node/NodeTest.php b/tests/lib/Files/Node/NodeTest.php
index a60a20b99f3..cc936baacb0 100644
--- a/tests/lib/Files/Node/NodeTest.php
+++ b/tests/lib/Files/Node/NodeTest.php
@@ -16,9 +16,9 @@ use OCP\Files\IRootFolder;
use OCP\Files\Node;
use OCP\Files\NotFoundException;
use OCP\Files\Storage;
-use OCP\ILogger;
use OCP\IUser;
use OCP\IUserManager;
+use Psr\Log\LoggerInterface;
/**
* Class NodeTest
@@ -36,7 +36,7 @@ abstract class NodeTest extends \Test\TestCase {
protected $root;
/** @var \OCP\Files\Config\IUserMountCache|\PHPUnit\Framework\MockObject\MockObject */
protected $userMountCache;
- /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
protected $logger;
/** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
protected $userManager;
@@ -56,7 +56,7 @@ abstract class NodeTest extends \Test\TestCase {
$this->userMountCache = $this->getMockBuilder('\OCP\Files\Config\IUserMountCache')
->disableOriginalConstructor()
->getMock();
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->userManager = $this->createMock(IUserManager::class);
$this->eventDispatcher = $this->createMock(IEventDispatcher::class);
$this->root = $this->getMockBuilder('\OC\Files\Node\Root')
diff --git a/tests/lib/Files/Node/RootTest.php b/tests/lib/Files/Node/RootTest.php
index a7f7dc02e01..fe151d70dc3 100644
--- a/tests/lib/Files/Node/RootTest.php
+++ b/tests/lib/Files/Node/RootTest.php
@@ -14,9 +14,9 @@ use OC\Files\Mount\Manager;
use OC\Files\Node\Folder;
use OC\Files\View;
use OCP\EventDispatcher\IEventDispatcher;
-use OCP\ILogger;
use OCP\IUser;
use OCP\IUserManager;
+use Psr\Log\LoggerInterface;
/**
* Class RootTest
@@ -30,7 +30,7 @@ class RootTest extends \Test\TestCase {
private $manager;
/** @var \OCP\Files\Config\IUserMountCache|\PHPUnit\Framework\MockObject\MockObject */
private $userMountCache;
- /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
private $logger;
/** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
private $userManager;
@@ -47,7 +47,7 @@ class RootTest extends \Test\TestCase {
$this->userMountCache = $this->getMockBuilder('\OCP\Files\Config\IUserMountCache')
->disableOriginalConstructor()
->getMock();
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->userManager = $this->createMock(IUserManager::class);
$this->eventDispatcher = $this->createMock(IEventDispatcher::class);
}
diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php
index 71af8fb7ece..9f63f173129 100644
--- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php
+++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php
@@ -19,7 +19,7 @@ use OCP\Files\Cache\ICache;
use OCP\Files\Mount\IMountPoint;
use OCP\ICacheFactory;
use OCP\IConfig;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\Files\Storage\Storage;
@@ -151,7 +151,7 @@ class EncryptionTest extends Storage {
->getMock();
$this->file->expects($this->any())->method('getAccessList')->willReturn([]);
- $this->logger = $this->createMock(Log::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->sourceStorage = new Temporary([]);
@@ -584,7 +584,7 @@ class EncryptionTest extends Storage {
$this->arrayCache
]
)->getMock();
-
+
$cache = $this->getMockBuilder('\OC\Files\Cache\Cache')
->disableOriginalConstructor()->getMock();
$cache->expects($this->any())
@@ -607,9 +607,9 @@ class EncryptionTest extends Storage {
)
->setMethods(['getCache','readFirstBlock', 'parseRawHeader'])
->getMock();
-
+
$instance->expects($this->once())->method('getCache')->willReturn($cache);
-
+
$instance->expects($this->once())->method(('parseRawHeader'))
->willReturn([Util::HEADER_ENCRYPTION_MODULE_KEY => 'OC_DEFAULT_MODULE']);
@@ -989,7 +989,6 @@ class EncryptionTest extends Storage {
) {
$encryptionManager = $this->createMock(\OC\Encryption\Manager::class);
$util = $this->createMock(Util::class);
- $logger = $this->createMock(ILogger::class);
$fileHelper = $this->createMock(IFile::class);
$uid = null;
$keyStorage = $this->createMock(IStorage::class);
@@ -1007,7 +1006,7 @@ class EncryptionTest extends Storage {
['mountPoint' => '', 'mount' => $mount, 'storage' => ''],
$encryptionManager,
$util,
- $logger,
+ $this->logger,
$fileHelper,
$uid,
$keyStorage,
diff --git a/tests/lib/Files/Type/DetectionTest.php b/tests/lib/Files/Type/DetectionTest.php
index a7ac6c8057d..568dbb0cf56 100644
--- a/tests/lib/Files/Type/DetectionTest.php
+++ b/tests/lib/Files/Type/DetectionTest.php
@@ -22,8 +22,8 @@
namespace Test\Files\Type;
use OC\Files\Type\Detection;
-use OCP\ILogger;
use OCP\IURLGenerator;
+use Psr\Log\LoggerInterface;
class DetectionTest extends \Test\TestCase {
/** @var Detection */
@@ -33,7 +33,7 @@ class DetectionTest extends \Test\TestCase {
parent::setUp();
$this->detection = new Detection(
\OC::$server->getURLGenerator(),
- \OC::$server->getLogger(),
+ \OC::$server->get(LoggerInterface::class),
\OC::$SERVERROOT . '/config/',
\OC::$SERVERROOT . '/resources/config/'
);
@@ -151,8 +151,8 @@ class DetectionTest extends \Test\TestCase {
->disableOriginalConstructor()
->getMock();
- /** @var ILogger $logger */
- $logger = $this->createMock(ILogger::class);
+ /** @var LoggerInterface $logger */
+ $logger = $this->createMock(LoggerInterface::class);
//Only call the url generator once
$urlGenerator->expects($this->once())
diff --git a/tests/lib/Files/Utils/ScannerTest.php b/tests/lib/Files/Utils/ScannerTest.php
index 414d38bae06..eb0b9938886 100644
--- a/tests/lib/Files/Utils/ScannerTest.php
+++ b/tests/lib/Files/Utils/ScannerTest.php
@@ -15,6 +15,7 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Config\IMountProvider;
use OCP\Files\Storage\IStorageFactory;
use OCP\IUser;
+use Psr\Log\LoggerInterface;
class TestScanner extends \OC\Files\Utils\Scanner {
/**
@@ -71,7 +72,7 @@ class ScannerTest extends \Test\TestCase {
$storage->file_put_contents('foo.txt', 'qwerty');
$storage->file_put_contents('folder/bar.txt', 'qwerty');
- $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$scanner->addMount($mount);
$scanner->scan('');
@@ -93,7 +94,7 @@ class ScannerTest extends \Test\TestCase {
$storage->file_put_contents('foo.txt', 'qwerty');
$storage->file_put_contents('folder/bar.txt', 'qwerty');
- $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$scanner->addMount($mount);
$scanner->scan('');
@@ -131,7 +132,7 @@ class ScannerTest extends \Test\TestCase {
$storage->file_put_contents('foo.txt', 'qwerty');
$storage->file_put_contents('folder/bar.txt', 'qwerty');
- $scanner = new \OC\Files\Utils\Scanner($uid, \OC::$server->getDatabaseConnection(), \OC::$server->query(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new \OC\Files\Utils\Scanner($uid, \OC::$server->getDatabaseConnection(), \OC::$server->query(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$this->assertFalse($cache->inCache('folder/bar.txt'));
$scanner->scan('/' . $uid . '/files/foo');
@@ -163,7 +164,7 @@ class ScannerTest extends \Test\TestCase {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid path to scan');
- $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$scanner->scan($invalidPath);
}
@@ -177,7 +178,7 @@ class ScannerTest extends \Test\TestCase {
$storage->file_put_contents('folder/bar.txt', 'qwerty');
$storage->touch('folder/bar.txt', time() - 200);
- $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$scanner->addMount($mount);
$scanner->scan('');
@@ -203,7 +204,7 @@ class ScannerTest extends \Test\TestCase {
$storage->file_put_contents('folder/bar.txt', 'qwerty');
$storage->file_put_contents('folder/subfolder/foobar.txt', 'qwerty');
- $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$scanner->addMount($mount);
$scanner->scan('', $recusive = false);
diff --git a/tests/lib/Group/ManagerTest.php b/tests/lib/Group/ManagerTest.php
index dfe21b825f7..d689fd4eb7a 100644
--- a/tests/lib/Group/ManagerTest.php
+++ b/tests/lib/Group/ManagerTest.php
@@ -26,9 +26,9 @@ namespace Test\Group;
use OC\Group\Database;
use OC\User\Manager;
use OCP\GroupInterface;
-use OCP\ILogger;
use OCP\IUser;
use PHPUnit\Framework\MockObject\MockObject;
+use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\TestCase;
@@ -37,7 +37,7 @@ class ManagerTest extends TestCase {
protected $userManager;
/** @var EventDispatcherInterface|MockObject */
protected $dispatcher;
- /** @var ILogger|MockObject */
+ /** @var LoggerInterface|MockObject */
protected $logger;
protected function setUp(): void {
@@ -45,7 +45,7 @@ class ManagerTest extends TestCase {
$this->userManager = $this->createMock(Manager::class);
$this->dispatcher = $this->createMock(EventDispatcherInterface::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
}
private function getTestUser($userId) {
diff --git a/tests/lib/Http/Client/ClientServiceTest.php b/tests/lib/Http/Client/ClientServiceTest.php
index f529e25966e..94f4d51ecee 100644
--- a/tests/lib/Http/Client/ClientServiceTest.php
+++ b/tests/lib/Http/Client/ClientServiceTest.php
@@ -17,7 +17,6 @@ use OC\Http\Client\DnsPinMiddleware;
use OC\Http\Client\LocalAddressChecker;
use OCP\ICertificateManager;
use OCP\IConfig;
-use OCP\ILogger;
/**
* Class ClientServiceTest
@@ -28,7 +27,6 @@ class ClientServiceTest extends \Test\TestCase {
$config = $this->createMock(IConfig::class);
/** @var ICertificateManager $certificateManager */
$certificateManager = $this->createMock(ICertificateManager::class);
- $logger = $this->createMock(ILogger::class);
$dnsPinMiddleware = $this->createMock(DnsPinMiddleware::class);
$dnsPinMiddleware
->expects($this->atLeastOnce())
@@ -39,7 +37,6 @@ class ClientServiceTest extends \Test\TestCase {
$clientService = new ClientService(
$config,
- $logger,
$certificateManager,
$dnsPinMiddleware,
$localAddressChecker
@@ -53,7 +50,6 @@ class ClientServiceTest extends \Test\TestCase {
$this->assertEquals(
new Client(
$config,
- $logger,
$certificateManager,
$guzzleClient,
$localAddressChecker
diff --git a/tests/lib/Http/Client/ClientTest.php b/tests/lib/Http/Client/ClientTest.php
index 395e82b8a4c..63835a4d4cd 100644
--- a/tests/lib/Http/Client/ClientTest.php
+++ b/tests/lib/Http/Client/ClientTest.php
@@ -15,7 +15,6 @@ use OC\Security\CertificateManager;
use OCP\Http\Client\LocalServerException;
use OCP\ICertificateManager;
use OCP\IConfig;
-use OCP\ILogger;
use PHPUnit\Framework\MockObject\MockObject;
/**
@@ -30,8 +29,6 @@ class ClientTest extends \Test\TestCase {
private $client;
/** @var IConfig|MockObject */
private $config;
- /** @var ILogger|MockObject */
- private $logger;
/** @var LocalAddressChecker|MockObject */
private $localAddressChecker;
/** @var array */
@@ -40,13 +37,11 @@ class ClientTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
- $this->logger = $this->createMock(ILogger::class);
$this->guzzleClient = $this->createMock(\GuzzleHttp\Client::class);
$this->certificateManager = $this->createMock(ICertificateManager::class);
$this->localAddressChecker = $this->createMock(LocalAddressChecker::class);
$this->client = new Client(
$this->config,
- $this->logger,
$this->certificateManager,
$this->guzzleClient,
$this->localAddressChecker
@@ -244,7 +239,7 @@ class ClientTest extends \Test\TestCase {
->method('ThrowIfLocalAddress')
->with('http://' . $uri)
->will($this->throwException(new LocalServerException()));
-
+
$this->client->post('http://' . $uri);
}
@@ -259,7 +254,7 @@ class ClientTest extends \Test\TestCase {
->method('ThrowIfLocalAddress')
->with('http://' . $uri)
->will($this->throwException(new LocalServerException()));
-
+
$this->client->put('http://' . $uri);
}
@@ -292,7 +287,7 @@ class ClientTest extends \Test\TestCase {
->method('getSystemValueBool')
->with('allow_local_remote_servers', false)
->willReturn(true);
-
+
$this->certificateManager
->expects($this->once())
->method('getAbsoluteBundlePath')
diff --git a/tests/lib/Http/Client/LocalAddressCheckerTest.php b/tests/lib/Http/Client/LocalAddressCheckerTest.php
index b2e09c0700b..0bba1cee5f4 100644
--- a/tests/lib/Http/Client/LocalAddressCheckerTest.php
+++ b/tests/lib/Http/Client/LocalAddressCheckerTest.php
@@ -26,9 +26,9 @@ declare(strict_types=1);
namespace Test\Http\Client;
-use OCP\ILogger;
use OCP\Http\Client\LocalServerException;
use OC\Http\Client\LocalAddressChecker;
+use Psr\Log\LoggerInterface;
class LocalAddressCheckerTest extends \Test\TestCase {
/** @var LocalAddressChecker */
@@ -37,7 +37,7 @@ class LocalAddressCheckerTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
- $logger = $this->createMock(ILogger::class);
+ $logger = $this->createMock(LoggerInterface::class);
$this->localAddressChecker = new LocalAddressChecker($logger);
}
diff --git a/tests/lib/Lock/DBLockingProviderTest.php b/tests/lib/Lock/DBLockingProviderTest.php
index 31abd330fed..d45c379ff08 100644
--- a/tests/lib/Lock/DBLockingProviderTest.php
+++ b/tests/lib/Lock/DBLockingProviderTest.php
@@ -23,6 +23,7 @@ namespace Test\Lock;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Lock\ILockingProvider;
+use Psr\Log\LoggerInterface;
/**
* Class DBLockingProvider
@@ -65,7 +66,7 @@ class DBLockingProviderTest extends LockingProvider {
*/
protected function getInstance() {
$this->connection = \OC::$server->getDatabaseConnection();
- return new \OC\Lock\DBLockingProvider($this->connection, \OC::$server->getLogger(), $this->timeFactory, 3600);
+ return new \OC\Lock\DBLockingProvider($this->connection, \OC::$server->get(LoggerInterface::class), $this->timeFactory, 3600);
}
protected function tearDown(): void {
diff --git a/tests/lib/Lock/NonCachingDBLockingProviderTest.php b/tests/lib/Lock/NonCachingDBLockingProviderTest.php
index a5da1f8de75..973337edb4e 100644
--- a/tests/lib/Lock/NonCachingDBLockingProviderTest.php
+++ b/tests/lib/Lock/NonCachingDBLockingProviderTest.php
@@ -22,6 +22,7 @@
namespace Test\Lock;
use OCP\Lock\ILockingProvider;
+use Psr\Log\LoggerInterface;
/**
* @group DB
@@ -34,7 +35,7 @@ class NonCachingDBLockingProviderTest extends DBLockingProviderTest {
*/
protected function getInstance() {
$this->connection = \OC::$server->getDatabaseConnection();
- return new \OC\Lock\DBLockingProvider($this->connection, \OC::$server->getLogger(), $this->timeFactory, 3600, false);
+ return new \OC\Lock\DBLockingProvider($this->connection, \OC::$server->get(LoggerInterface::class), $this->timeFactory, 3600, false);
}
public function testDoubleShared() {
diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php
index 335f373f8c1..e96cda26398 100644
--- a/tests/lib/Mail/MailerTest.php
+++ b/tests/lib/Mail/MailerTest.php
@@ -18,10 +18,10 @@ use OCP\Defaults;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IL10N;
-use OCP\ILogger;
use OCP\IURLGenerator;
use OCP\L10N\IFactory;
use OCP\Mail\Events\BeforeMessageSent;
+use Psr\Log\LoggerInterface;
use Swift_SwiftException;
use Test\TestCase;
@@ -30,7 +30,7 @@ class MailerTest extends TestCase {
private $config;
/** @var Defaults|\PHPUnit\Framework\MockObject\MockObject */
private $defaults;
- /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
private $logger;
/** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
private $urlGenerator;
@@ -47,7 +47,7 @@ class MailerTest extends TestCase {
$this->config = $this->createMock(IConfig::class);
$this->defaults = $this->createMock(Defaults::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->l10n = $this->createMock(IL10N::class);
$this->dispatcher = $this->createMock(IEventDispatcher::class);
diff --git a/tests/lib/Memcache/FactoryTest.php b/tests/lib/Memcache/FactoryTest.php
index 858bdc5d3ef..0e995865b5d 100644
--- a/tests/lib/Memcache/FactoryTest.php
+++ b/tests/lib/Memcache/FactoryTest.php
@@ -22,7 +22,7 @@
namespace Test\Memcache;
use OC\Memcache\NullCache;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
class Test_Factory_Available_Cache1 extends NullCache {
public function __construct($prefix = '') {
@@ -118,7 +118,7 @@ class FactoryTest extends \Test\TestCase {
*/
public function testCacheAvailability($localCache, $distributedCache, $lockingCache,
$expectedLocalCache, $expectedDistributedCache, $expectedLockingCache) {
- $logger = $this->getMockBuilder(ILogger::class)->getMock();
+ $logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
$factory = new \OC\Memcache\Factory('abc', $logger, $localCache, $distributedCache, $lockingCache);
$this->assertTrue(is_a($factory->createLocal(), $expectedLocalCache));
$this->assertTrue(is_a($factory->createDistributed(), $expectedDistributedCache));
@@ -131,7 +131,7 @@ class FactoryTest extends \Test\TestCase {
public function testCacheNotAvailableException($localCache, $distributedCache) {
$this->expectException(\OCP\HintException::class);
- $logger = $this->getMockBuilder(ILogger::class)->getMock();
+ $logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
new \OC\Memcache\Factory('abc', $logger, $localCache, $distributedCache);
}
}
diff --git a/tests/lib/Route/RouterTest.php b/tests/lib/Route/RouterTest.php
index 4fcd9d65cd1..1f03f4edecb 100644
--- a/tests/lib/Route/RouterTest.php
+++ b/tests/lib/Route/RouterTest.php
@@ -24,7 +24,7 @@ declare(strict_types=1);
namespace Test\Route;
use OC\Route\Router;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
use Test\TestCase;
/**
@@ -34,8 +34,8 @@ use Test\TestCase;
*/
class RouterTest extends TestCase {
public function testGenerateConsecutively(): void {
- /** @var ILogger $logger */
- $logger = $this->createMock(ILogger::class);
+ /** @var LoggerInterface $logger */
+ $logger = $this->createMock(LoggerInterface::class);
$router = new Router($logger);
$this->assertEquals('/index.php/apps/files/', $router->generate('files.view.index'));
diff --git a/tests/lib/Security/Bruteforce/ThrottlerTest.php b/tests/lib/Security/Bruteforce/ThrottlerTest.php
index fb28a7c9c7a..6639f884ae1 100644
--- a/tests/lib/Security/Bruteforce/ThrottlerTest.php
+++ b/tests/lib/Security/Bruteforce/ThrottlerTest.php
@@ -28,7 +28,7 @@ use OC\AppFramework\Utility\TimeFactory;
use OC\Security\Bruteforce\Throttler;
use OCP\IConfig;
use OCP\IDBConnection;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
use Test\TestCase;
/**
@@ -42,14 +42,14 @@ class ThrottlerTest extends TestCase {
private $throttler;
/** @var IDBConnection */
private $dbConnection;
- /** @var ILogger */
+ /** @var LoggerInterface */
private $logger;
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
private $config;
protected function setUp(): void {
$this->dbConnection = $this->createMock(IDBConnection::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->config = $this->createMock(IConfig::class);
$this->throttler = new Throttler(
diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php
index c50296c2a33..b1659d1096d 100644
--- a/tests/lib/Security/CertificateManagerTest.php
+++ b/tests/lib/Security/CertificateManagerTest.php
@@ -14,8 +14,8 @@ namespace Test\Security;
use OC\Files\View;
use OC\Security\CertificateManager;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\Security\ISecureRandom;
+use Psr\Log\LoggerInterface;
/**
* Class CertificateManagerTest
@@ -58,7 +58,7 @@ class CertificateManagerTest extends \Test\TestCase {
$this->certificateManager = new CertificateManager(
new \OC\Files\View(),
$config,
- $this->createMock(ILogger::class),
+ $this->createMock(LoggerInterface::class),
$this->random
);
}
@@ -156,7 +156,7 @@ class CertificateManagerTest extends \Test\TestCase {
/** @var CertificateManager | \PHPUnit\Framework\MockObject\MockObject $certificateManager */
$certificateManager = $this->getMockBuilder('OC\Security\CertificateManager')
- ->setConstructorArgs([$view, $config, $this->createMock(ILogger::class), $this->random])
+ ->setConstructorArgs([$view, $config, $this->createMock(LoggerInterface::class), $this->random])
->setMethods(['getFilemtimeOfCaBundle', 'getCertificateBundle'])
->getMock();
diff --git a/tests/lib/Security/IdentityProof/ManagerTest.php b/tests/lib/Security/IdentityProof/ManagerTest.php
index 0a6f97f3fcd..968cfa633ca 100644
--- a/tests/lib/Security/IdentityProof/ManagerTest.php
+++ b/tests/lib/Security/IdentityProof/ManagerTest.php
@@ -32,10 +32,10 @@ use OCP\Files\IAppData;
use OCP\Files\SimpleFS\ISimpleFile;
use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IUser;
use OCP\Security\ICrypto;
use PHPUnit\Framework\MockObject\MockObject;
+use Psr\Log\LoggerInterface;
use Test\TestCase;
class ManagerTest extends TestCase {
@@ -49,7 +49,7 @@ class ManagerTest extends TestCase {
private $manager;
/** @var IConfig|MockObject */
private $config;
- /** @var ILogger|MockObject */
+ /** @var LoggerInterface|MockObject */
private $logger;
protected function setUp(): void {
@@ -63,7 +63,7 @@ class ManagerTest extends TestCase {
->method('get')
->with('identityproof')
->willReturn($this->appData);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->crypto = $this->createMock(ICrypto::class);
$this->manager = $this->getManager(['generateKeyPair']);
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php
index 93f33fe30b9..9b8bc629594 100644
--- a/tests/lib/Share20/ManagerTest.php
+++ b/tests/lib/Share20/ManagerTest.php
@@ -41,7 +41,6 @@ use OCP\IConfig;
use OCP\IGroup;
use OCP\IGroupManager;
use OCP\IL10N;
-use OCP\ILogger;
use OCP\IServerContainer;
use OCP\IURLGenerator;
use OCP\IUser;
@@ -60,6 +59,7 @@ use OCP\Share\IShare;
use OCP\Share\IShareProvider;
use PHPUnit\Framework\MockObject\MockBuilder;
use PHPUnit\Framework\MockObject\MockObject;
+use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
@@ -73,7 +73,7 @@ class ManagerTest extends \Test\TestCase {
/** @var Manager */
protected $manager;
- /** @var ILogger|MockObject */
+ /** @var LoggerInterface|MockObject */
protected $logger;
/** @var IConfig|MockObject */
protected $config;
@@ -113,7 +113,7 @@ class ManagerTest extends \Test\TestCase {
protected $knownUserService;
protected function setUp(): void {
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->config = $this->createMock(IConfig::class);
$this->secureRandom = $this->createMock(ISecureRandom::class);
$this->hasher = $this->createMock(IHasher::class);
diff --git a/tests/lib/TempManagerTest.php b/tests/lib/TempManagerTest.php
index fd4ef8e2324..b85bbc8098b 100644
--- a/tests/lib/TempManagerTest.php
+++ b/tests/lib/TempManagerTest.php
@@ -34,8 +34,8 @@ class TempManagerTest extends \Test\TestCase {
}
/**
- * @param \OCP\ILogger $logger
- * @param \OCP\IConfig $config
+ * @param ?LoggerInterface $logger
+ * @param ?IConfig $config
* @return \OC\TempManager
*/
protected function getManager($logger = null, $config = null) {
diff --git a/tests/lib/Template/CSSResourceLocatorTest.php b/tests/lib/Template/CSSResourceLocatorTest.php
index 3a66d738f25..4832b03fe9b 100644
--- a/tests/lib/Template/CSSResourceLocatorTest.php
+++ b/tests/lib/Template/CSSResourceLocatorTest.php
@@ -34,8 +34,8 @@ use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Files\IAppData;
use OCP\ICacheFactory;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IURLGenerator;
+use Psr\Log\LoggerInterface;
class CSSResourceLocatorTest extends \Test\TestCase {
/** @var IAppData|\PHPUnit\Framework\MockObject\MockObject */
@@ -48,7 +48,7 @@ class CSSResourceLocatorTest extends \Test\TestCase {
protected $themingDefaults;
/** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */
protected $cacheFactory;
- /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
protected $logger;
/** @var IconsCacher|\PHPUnit\Framework\MockObject\MockObject */
protected $iconsCacher;
@@ -60,7 +60,7 @@ class CSSResourceLocatorTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->appData = $this->createMock(AppData::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->config = $this->createMock(IConfig::class);
diff --git a/tests/lib/Template/IconsCacherTest.php b/tests/lib/Template/IconsCacherTest.php
index 24b3c21052f..44e7f8075af 100644
--- a/tests/lib/Template/IconsCacherTest.php
+++ b/tests/lib/Template/IconsCacherTest.php
@@ -32,11 +32,11 @@ use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Files\IAppData;
use OCP\Files\SimpleFS\ISimpleFile;
use OCP\Files\SimpleFS\ISimpleFolder;
-use OCP\ILogger;
use OCP\IURLGenerator;
+use Psr\Log\LoggerInterface;
class IconsCacherTest extends \Test\TestCase {
- /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
protected $logger;
/** @var IAppData|\PHPUnit\Framework\MockObject\MockObject */
protected $appData;
@@ -46,7 +46,7 @@ class IconsCacherTest extends \Test\TestCase {
private $timeFactory;
protected function setUp(): void {
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->appData = $this->createMock(AppData::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
@@ -110,7 +110,7 @@ class IconsCacherTest extends \Test\TestCase {
";
$expected = "
icon.test {
-
+
background-image: var(--icon-test);
}
";
@@ -133,7 +133,7 @@ class IconsCacherTest extends \Test\TestCase {
";
$expected = "
icon.test {
-
+
background-image: var(--icon-test);
}
";
diff --git a/tests/lib/Template/JSCombinerTest.php b/tests/lib/Template/JSCombinerTest.php
index 87abff99123..5c678840c63 100644
--- a/tests/lib/Template/JSCombinerTest.php
+++ b/tests/lib/Template/JSCombinerTest.php
@@ -32,8 +32,8 @@ use OCP\Files\SimpleFS\ISimpleFile;
use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\ICache;
use OCP\ICacheFactory;
-use OCP\ILogger;
use OCP\IURLGenerator;
+use Psr\Log\LoggerInterface;
class JSCombinerTest extends \Test\TestCase {
/** @var IAppData|\PHPUnit\Framework\MockObject\MockObject */
@@ -46,7 +46,7 @@ class JSCombinerTest extends \Test\TestCase {
protected $depsCache;
/** @var JSCombiner */
protected $jsCombiner;
- /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
protected $logger;
/** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */
protected $cacheFactory;
@@ -62,7 +62,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->cacheFactory->expects($this->at(0))
->method('createDistributed')
->willReturn($this->depsCache);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->jsCombiner = new JSCombiner(
$this->appData,
$this->urlGenerator,
diff --git a/tests/lib/Template/JSResourceLocatorTest.php b/tests/lib/Template/JSResourceLocatorTest.php
index e3e1398dd17..7dedd4ad3c7 100644
--- a/tests/lib/Template/JSResourceLocatorTest.php
+++ b/tests/lib/Template/JSResourceLocatorTest.php
@@ -28,8 +28,8 @@ use OC\Template\JSCombiner;
use OC\Template\JSResourceLocator;
use OCP\Files\IAppData;
use OCP\ICacheFactory;
-use OCP\ILogger;
use OCP\IURLGenerator;
+use Psr\Log\LoggerInterface;
class JSResourceLocatorTest extends \Test\TestCase {
/** @var IAppData|\PHPUnit\Framework\MockObject\MockObject */
@@ -40,7 +40,7 @@ class JSResourceLocatorTest extends \Test\TestCase {
protected $config;
/** @var ICacheFactory|\PHPUnit\Framework\MockObject\MockObject */
protected $cacheFactory;
- /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
protected $logger;
protected function setUp(): void {
@@ -50,7 +50,7 @@ class JSResourceLocatorTest extends \Test\TestCase {
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->config = $this->createMock(SystemConfig::class);
$this->cacheFactory = $this->createMock(ICacheFactory::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
}
private function jsResourceLocator() {
diff --git a/tests/lib/Template/ResourceLocatorTest.php b/tests/lib/Template/ResourceLocatorTest.php
index 04691451079..0cb28843a53 100644
--- a/tests/lib/Template/ResourceLocatorTest.php
+++ b/tests/lib/Template/ResourceLocatorTest.php
@@ -9,7 +9,7 @@
namespace Test\Template;
use OC\Template\ResourceNotFoundException;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
class ResourceLocatorTest extends \Test\TestCase {
/** @var \PHPUnit\Framework\MockObject\MockObject */
@@ -17,7 +17,7 @@ class ResourceLocatorTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
}
/**
diff --git a/tests/lib/Template/SCSSCacherTest.php b/tests/lib/Template/SCSSCacherTest.php
index 15966521a53..f7b7b3bb6d3 100644
--- a/tests/lib/Template/SCSSCacherTest.php
+++ b/tests/lib/Template/SCSSCacherTest.php
@@ -37,11 +37,11 @@ use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\ICache;
use OCP\ICacheFactory;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IURLGenerator;
+use Psr\Log\LoggerInterface;
class SCSSCacherTest extends \Test\TestCase {
- /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
protected $logger;
/** @var IAppData|\PHPUnit\Framework\MockObject\MockObject */
protected $appData;
@@ -68,7 +68,7 @@ class SCSSCacherTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->appData = $this->createMock(AppData::class);
$this->iconsCacher = $this->createMock(IconsCacher::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
diff --git a/tests/lib/Traits/EncryptionTrait.php b/tests/lib/Traits/EncryptionTrait.php
index 9cb64c12d00..23f188ccd66 100644
--- a/tests/lib/Traits/EncryptionTrait.php
+++ b/tests/lib/Traits/EncryptionTrait.php
@@ -16,6 +16,7 @@ use OCA\Encryption\KeyManager;
use OCA\Encryption\Users\Setup;
use OCP\Encryption\IManager;
use OCP\IUserManager;
+use Psr\Log\LoggerInterface;
/**
* Enables encryption
@@ -82,7 +83,7 @@ trait EncryptionTrait {
$encryptionWrapper = new EncryptionWrapper(
new ArrayCache(),
\OC::$server->getEncryptionManager(),
- \OC::$server->getLogger()
+ \OC::$server->get(LoggerInterface::class)
);
$this->registerStorageWrapper('oc_encryption', [$encryptionWrapper, 'wrapStorage']);
diff --git a/tests/lib/Updater/ChangesCheckTest.php b/tests/lib/Updater/ChangesCheckTest.php
index 223cbb45f66..02da6d08401 100644
--- a/tests/lib/Updater/ChangesCheckTest.php
+++ b/tests/lib/Updater/ChangesCheckTest.php
@@ -33,8 +33,8 @@ use OCP\AppFramework\Db\DoesNotExistException;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
-use OCP\ILogger;
use Test\TestCase;
+use Psr\Log\LoggerInterface;
class ChangesCheckTest extends TestCase {
/** @var IClientService|\PHPUnit\Framework\MockObject\MockObject */
@@ -46,7 +46,7 @@ class ChangesCheckTest extends TestCase {
/** @var ChangesMapper|\PHPUnit\Framework\MockObject\MockObject */
protected $mapper;
- /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
protected $logger;
protected function setUp(): void {
@@ -54,7 +54,7 @@ class ChangesCheckTest extends TestCase {
$this->clientService = $this->createMock(IClientService::class);
$this->mapper = $this->createMock(ChangesMapper::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->checker = new ChangesCheck($this->clientService, $this->mapper, $this->logger);
}
diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php
index fcd45bab5bd..0e199e5d5b5 100644
--- a/tests/lib/User/SessionTest.php
+++ b/tests/lib/User/SessionTest.php
@@ -24,7 +24,6 @@ use OCP\AppFramework\Utility\ITimeFactory;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\ICacheFactory;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IRequest;
use OCP\IRequestId;
use OCP\ISession;
@@ -33,6 +32,7 @@ use OCP\Lockdown\ILockdownManager;
use OCP\Security\ISecureRandom;
use OCP\User\Events\PostLoginEvent;
use PHPUnit\Framework\MockObject\MockObject;
+use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use OC\Security\CSRF\CsrfTokenManager;
@@ -57,7 +57,7 @@ class SessionTest extends \Test\TestCase {
private $userSession;
/** @var ILockdownManager|MockObject */
private $lockdownManager;
- /** @var ILogger|MockObject */
+ /** @var LoggerInterface|MockObject */
private $logger;
/** @var IEventDispatcher|MockObject */
private $dispatcher;
@@ -76,7 +76,7 @@ class SessionTest extends \Test\TestCase {
$this->manager = $this->createMock(Manager::class);
$this->session = $this->createMock(ISession::class);
$this->lockdownManager = $this->createMock(ILockdownManager::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->dispatcher = $this->createMock(IEventDispatcher::class);
$this->userSession = $this->getMockBuilder(Session::class)
->setConstructorArgs([