Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>tags/v24.0.0beta2
@@ -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); |
@@ -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 |
@@ -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 |
@@ -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); | |||
} |
@@ -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); |
@@ -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, |
@@ -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 { |
@@ -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); |
@@ -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); | |||
@@ -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) | |||
); |
@@ -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) | |||
); |
@@ -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') |
@@ -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); | |||
} |
@@ -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, |
@@ -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()) |
@@ -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); |
@@ -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) { |
@@ -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 |
@@ -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') |
@@ -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); | |||
} | |||
@@ -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 { |
@@ -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() { |
@@ -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); |
@@ -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); | |||
} | |||
} |
@@ -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')); |
@@ -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( |
@@ -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(); | |||
@@ -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']); |
@@ -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); |
@@ -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) { |
@@ -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); |
@@ -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); | |||
} | |||
"; |
@@ -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, |
@@ -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() { |
@@ -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); | |||
} | |||
/** |
@@ -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); |
@@ -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']); |
@@ -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); | |||
} |
@@ -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([ |