summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-11-14 16:14:35 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-11-14 16:14:35 +0100
commit70e2217d1c23dbe7062c188091c0d9f10a5bd84b (patch)
tree32ee4dc89475f735f621d5ad864896f82d954b93 /tests
parentea377578ad50809c13e792acfa2bc1bd6b94df24 (diff)
downloadnextcloud-server-70e2217d1c23dbe7062c188091c0d9f10a5bd84b.tar.gz
nextcloud-server-70e2217d1c23dbe7062c188091c0d9f10a5bd84b.zip
Fix dynamic properties and other problems in tests for PHP 8.2
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/DB/MigrationsTest.php4
-rw-r--r--tests/lib/Encryption/Keys/StorageTest.php9
-rw-r--r--tests/lib/Security/VerificationToken/VerificationTokenTest.php11
-rw-r--r--tests/lib/Settings/ManagerTest.php20
4 files changed, 26 insertions, 18 deletions
diff --git a/tests/lib/DB/MigrationsTest.php b/tests/lib/DB/MigrationsTest.php
index 3d115f25adf..b7d49b565ac 100644
--- a/tests/lib/DB/MigrationsTest.php
+++ b/tests/lib/DB/MigrationsTest.php
@@ -31,7 +31,6 @@ use OCP\Migration\IMigrationStep;
* @package Test\DB
*/
class MigrationsTest extends \Test\TestCase {
-
/** @var MigrationService | \PHPUnit\Framework\MockObject\MockObject */
private $migrationService;
/** @var \PHPUnit\Framework\MockObject\MockObject | IDBConnection $db */
@@ -247,6 +246,9 @@ class MigrationsTest extends \Test\TestCase {
->willReturn(\str_repeat('a', 30));
$primaryKey = $this->createMock(Index::class);
+ $primaryKey->expects($this->once())
+ ->method('getName')
+ ->willReturn(\str_repeat('a', 30));
$table->expects($this->once())
->method('getColumns')
diff --git a/tests/lib/Encryption/Keys/StorageTest.php b/tests/lib/Encryption/Keys/StorageTest.php
index bb7bbbcd7c1..5301453c191 100644
--- a/tests/lib/Encryption/Keys/StorageTest.php
+++ b/tests/lib/Encryption/Keys/StorageTest.php
@@ -31,22 +31,23 @@ use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class StorageTest extends TestCase {
-
/** @var Storage */
protected $storage;
- /** @var \PHPUnit\Framework\MockObject\MockObject */
+ /** @var MockObject */
protected $util;
- /** @var \PHPUnit\Framework\MockObject\MockObject */
+ /** @var MockObject */
protected $view;
- /** @var \PHPUnit\Framework\MockObject\MockObject */
+ /** @var MockObject */
protected $config;
/** @var MockObject|ICrypto */
protected $crypto;
+ private array $mkdirStack = [];
+
protected function setUp(): void {
parent::setUp();
diff --git a/tests/lib/Security/VerificationToken/VerificationTokenTest.php b/tests/lib/Security/VerificationToken/VerificationTokenTest.php
index 4d90e304ab7..3dd8923362c 100644
--- a/tests/lib/Security/VerificationToken/VerificationTokenTest.php
+++ b/tests/lib/Security/VerificationToken/VerificationTokenTest.php
@@ -35,18 +35,21 @@ use OCP\Security\ICrypto;
use OCP\Security\ISecureRandom;
use OCP\Security\VerificationToken\InvalidTokenException;
use Test\TestCase;
+use PHPUnit\Framework\MockObject\MockObject;
class VerificationTokenTest extends TestCase {
/** @var VerificationToken */
protected $token;
- /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IConfig|MockObject */
protected $config;
- /** @var ISecureRandom|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var ISecureRandom|MockObject */
protected $secureRandom;
- /** @var ICrypto|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var ICrypto|MockObject */
protected $crypto;
- /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var ITimeFactory|MockObject */
protected $timeFactory;
+ /** @var IJobList|MockObject */
+ protected $jobList
protected function setUp(): void {
parent::setUp();
diff --git a/tests/lib/Settings/ManagerTest.php b/tests/lib/Settings/ManagerTest.php
index 29ae33c3c93..cc13479b1d0 100644
--- a/tests/lib/Settings/ManagerTest.php
+++ b/tests/lib/Settings/ManagerTest.php
@@ -36,24 +36,26 @@ use OCP\Settings\ISettings;
use OCP\Settings\ISubAdminSettings;
use Psr\Log\LoggerInterface;
use Test\TestCase;
+use PHPUnit\Framework\MockObject\MockObject;
class ManagerTest extends TestCase {
-
- /** @var Manager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var Manager|MockObject */
private $manager;
- /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|MockObject */
private $logger;
- /** @var IDBConnection|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IDBConnection|MockObject */
private $l10n;
- /** @var IFactory|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IFactory|MockObject */
private $l10nFactory;
- /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IURLGenerator|MockObject */
private $url;
- /** @var IServerContainer|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IServerContainer|MockObject */
private $container;
- /** @var IGroupManager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var AuthorizedGroupMapper|MockObject */
+ private $mapper;
+ /** @var IGroupManager|MockObject */
private $groupManager;
- /** @var ISubAdmin|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var ISubAdmin|MockObject */
private $subAdmin;
protected function setUp(): void {