diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-11-14 17:06:28 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-11-14 17:08:21 +0100 |
commit | c79a6b3f62948075f7ce67a0294b0410fd61af3d (patch) | |
tree | d67ee83d8c0fd892ce722b40b3f859d76ff20ebe /apps/dav/tests | |
parent | 70e2217d1c23dbe7062c188091c0d9f10a5bd84b (diff) | |
download | nextcloud-server-c79a6b3f62948075f7ce67a0294b0410fd61af3d.tar.gz nextcloud-server-c79a6b3f62948075f7ce67a0294b0410fd61af3d.zip |
Fix errors from PHP 8.2 testing
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/dav/tests')
6 files changed, 14 insertions, 15 deletions
diff --git a/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php b/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php index fd27b4d2776..d3b7ca92581 100644 --- a/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php +++ b/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php @@ -32,12 +32,10 @@ namespace OCA\DAV\Tests\unit\BackgroundJob; use OCA\DAV\BackgroundJob\CleanupInvitationTokenJob; use OCP\AppFramework\Utility\ITimeFactory; use OCP\DB\QueryBuilder\IQueryBuilder; -use OCP\DB\QueryBuilder\IQueryFunction; use OCP\IDBConnection; use Test\TestCase; class CleanupInvitationTokenJobTest extends TestCase { - /** @var IDBConnection | \PHPUnit\Framework\MockObject\MockObject */ private $dbConnection; @@ -78,7 +76,7 @@ class CleanupInvitationTokenJobTest extends TestCase { [1337, \PDO::PARAM_STR, null, 'namedParameter1337'] ]); - $function = $this->createMock(IQueryFunction::class); + $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/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 576fde2d4af..efbad5e3008 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') |