summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2022-12-05 12:03:39 +0100
committerGitHub <noreply@github.com>2022-12-05 12:03:39 +0100
commit30560d316584276a08c909f5198a839c1c170cc9 (patch)
tree154477dee76d6b7451671010aa2318c500975521 /apps/dav/tests
parentcb0450b5c4fbe590e7b35284a40d78d96a0251f6 (diff)
parent4196bf81e653c39d33d25c76652cc78dab8c5e1c (diff)
downloadnextcloud-server-30560d316584276a08c909f5198a839c1c170cc9.tar.gz
nextcloud-server-30560d316584276a08c909f5198a839c1c170cc9.zip
Merge branch 'master' into tests/fix-phpunit-warnings
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php2
-rw-r--r--apps/dav/tests/unit/BackgroundJob/PruneOutdatedSyncTokensJobTest.php3
-rw-r--r--apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php5
-rw-r--r--apps/dav/tests/unit/CardDAV/Activity/BackendTest.php4
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php4
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php9
-rw-r--r--apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php4
7 files changed, 16 insertions, 15 deletions
diff --git a/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php b/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php
index ee43bae5355..d3b7ca92581 100644
--- a/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php
+++ b/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php
@@ -76,7 +76,7 @@ class CleanupInvitationTokenJobTest extends TestCase {
[1337, \PDO::PARAM_STR, null, 'namedParameter1337']
]);
- $function = 'fakefunction';
+ $function = 'function1337';
$expr->expects($this->once())
->method('lt')
->with('expiration', 'namedParameter1337')
diff --git a/apps/dav/tests/unit/BackgroundJob/PruneOutdatedSyncTokensJobTest.php b/apps/dav/tests/unit/BackgroundJob/PruneOutdatedSyncTokensJobTest.php
index 991caafd597..1de56b37d80 100644
--- a/apps/dav/tests/unit/BackgroundJob/PruneOutdatedSyncTokensJobTest.php
+++ b/apps/dav/tests/unit/BackgroundJob/PruneOutdatedSyncTokensJobTest.php
@@ -34,13 +34,14 @@ use OCA\DAV\BackgroundJob\PruneOutdatedSyncTokensJob;
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CardDAV\CardDavBackend;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\DB\Exception;
use OCP\IConfig;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase;
class PruneOutdatedSyncTokensJobTest extends TestCase {
+ /** @var ITimeFactory | MockObject */
+ private $timeFactory;
/** @var CalDavBackend | MockObject */
private $calDavBackend;
diff --git a/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php b/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php
index 79d9376650b..e2b5390f875 100644
--- a/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php
+++ b/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php
@@ -40,13 +40,11 @@ use OCP\IConfig;
use OCP\IGroupManager;
use OCP\IUser;
use OCP\IUserManager;
-use OCP\IUserSession;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase;
class ReminderServiceTest extends TestCase {
-
/** @var Backend|MockObject */
private $backend;
@@ -74,6 +72,9 @@ class ReminderServiceTest extends TestCase {
/** @var MockObject|LoggerInterface */
private $logger;
+ /** @var MockObject|Principal */
+ private $principalConnector;
+
public const CALENDAR_DATA = <<<EOD
BEGIN:VCALENDAR
PRODID:-//Nextcloud calendar v1.6.4
diff --git a/apps/dav/tests/unit/CardDAV/Activity/BackendTest.php b/apps/dav/tests/unit/CardDAV/Activity/BackendTest.php
index 4f3459233aa..bd5660747ff 100644
--- a/apps/dav/tests/unit/CardDAV/Activity/BackendTest.php
+++ b/apps/dav/tests/unit/CardDAV/Activity/BackendTest.php
@@ -40,7 +40,6 @@ use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class BackendTest extends TestCase {
-
/** @var IManager|MockObject */
protected $activityManager;
@@ -53,6 +52,9 @@ class BackendTest extends TestCase {
/** @var IAppManager|MockObject */
protected $appManager;
+ /** @var IUserManager|MockObject */
+ protected $userManager;
+
protected function setUp(): void {
parent::setUp();
$this->activityManager = $this->createMock(IManager::class);
diff --git a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
index 4d2771132cc..e9d43f77cca 100644
--- a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
@@ -82,7 +82,7 @@ class BlockLegacyClientPluginTest extends TestCase {
$this->config
->expects($this->once())
->method('getSystemValue')
- ->with('minimum.supported.desktop.version', '2.0.0')
+ ->with('minimum.supported.desktop.version', '2.3.0')
->willReturn('1.7.0');
$this->blockLegacyClientVersionPlugin->beforeHandler($request);
@@ -117,7 +117,7 @@ class BlockLegacyClientPluginTest extends TestCase {
$this->config
->expects($this->once())
->method('getSystemValue')
- ->with('minimum.supported.desktop.version', '2.0.0')
+ ->with('minimum.supported.desktop.version', '2.3.0')
->willReturn('1.7.0');
$this->blockLegacyClientVersionPlugin->beforeHandler($request);
diff --git a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
index 7cd31e3b8dd..2614f541613 100644
--- a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
@@ -54,7 +54,6 @@ use Sabre\DAV\PropPatch;
use Test\TestCase;
class PrincipalTest extends TestCase {
-
/** @var IUserManager | MockObject */
private $userManager;
@@ -658,12 +657,12 @@ class PrincipalTest extends TestCase {
$user2->method('getSystemEMailAddress')->willReturn('user2@foo.bar');
$user3 = $this->createMock(IUser::class);
$user3->method('getUID')->willReturn('user3');
- $user2->method('getDisplayName')->willReturn('User 22');
- $user2->method('getSystemEMailAddress')->willReturn('user2@foo.bar123');
+ $user3->method('getDisplayName')->willReturn('User 22');
+ $user3->method('getSystemEMailAddress')->willReturn('user2@foo.bar123');
$user4 = $this->createMock(IUser::class);
$user4->method('getUID')->willReturn('user4');
- $user2->method('getDisplayName')->willReturn('User 222');
- $user2->method('getSystemEMailAddress')->willReturn('user2@foo.bar456');
+ $user4->method('getDisplayName')->willReturn('User 222');
+ $user4->method('getSystemEMailAddress')->willReturn('user2@foo.bar456');
$this->userManager->expects($this->at(0))
->method('searchDisplayName')
diff --git a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php
index 3e6886964c9..fdbb69e6c0d 100644
--- a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php
+++ b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php
@@ -37,14 +37,12 @@ use OCP\AppFramework\Utility\ITimeFactory;
use OCP\DB\IResult;
use OCP\DB\QueryBuilder\IExpressionBuilder;
use OCP\DB\QueryBuilder\IQueryBuilder;
-use OCP\DB\QueryBuilder\IQueryFunction;
use OCP\IDBConnection;
use OCP\IRequest;
use Sabre\VObject\ITip\Message;
use Test\TestCase;
class InvitationResponseControllerTest extends TestCase {
-
/** @var InvitationResponseController */
private $controller;
@@ -478,7 +476,7 @@ EOF;
->with(\PDO::FETCH_ASSOC)
->willReturn($return);
- $function = $this->createMock(IQueryFunction::class);
+ $function = 'functionToken';
$expr->expects($this->once())
->method('eq')
->with('token', 'namedParameterToken')