aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-03-28 16:13:19 +0100
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>2024-04-02 14:16:21 +0200
commitec5133b739eabc76271789504b4dbb91a534f552 (patch)
tree880b81f5ebd11b289c67e4bcdd1ecaa41aedbcb4 /tests/lib
parentb074399a87e764f506550d64f6379738186355c6 (diff)
downloadnextcloud-server-ec5133b739eabc76271789504b4dbb91a534f552.tar.gz
nextcloud-server-ec5133b739eabc76271789504b4dbb91a534f552.zip
fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/Accounts/AccountManagerTest.php2
-rw-r--r--tests/lib/BackgroundJob/DummyJobList.php2
-rw-r--r--tests/lib/BackgroundJob/TestJob.php2
-rw-r--r--tests/lib/BackgroundJob/TestParallelAwareJob.php2
-rw-r--r--tests/lib/Comments/FakeManager.php4
-rw-r--r--tests/lib/Files/ObjectStore/FailDeleteObjectStore.php2
-rw-r--r--tests/lib/Files/ObjectStore/FailWriteObjectStore.php2
-rw-r--r--tests/lib/Files/ObjectStore/S3Test.php2
-rw-r--r--tests/lib/L10N/FactoryTest.php2
-rw-r--r--tests/lib/TestCase.php2
10 files changed, 11 insertions, 11 deletions
diff --git a/tests/lib/Accounts/AccountManagerTest.php b/tests/lib/Accounts/AccountManagerTest.php
index 3d0bee5902f..632bbe4d6ac 100644
--- a/tests/lib/Accounts/AccountManagerTest.php
+++ b/tests/lib/Accounts/AccountManagerTest.php
@@ -125,7 +125,7 @@ class AccountManagerTest extends TestCase {
$query->delete($this->table)->executeStatement();
}
- protected function makeUser(string $uid, string $name, string $email = null): IUser {
+ protected function makeUser(string $uid, string $name, ?string $email = null): IUser {
$user = $this->createMock(IUser::class);
$user->expects($this->any())
->method('getUid')
diff --git a/tests/lib/BackgroundJob/DummyJobList.php b/tests/lib/BackgroundJob/DummyJobList.php
index 05a9e5928c2..64c0cf8038e 100644
--- a/tests/lib/BackgroundJob/DummyJobList.php
+++ b/tests/lib/BackgroundJob/DummyJobList.php
@@ -35,7 +35,7 @@ class DummyJobList extends \OC\BackgroundJob\JobList {
* @param IJob|class-string<IJob> $job
* @param mixed $argument
*/
- public function add($job, $argument = null, int $firstCheck = null): void {
+ public function add($job, $argument = null, ?int $firstCheck = null): void {
if (is_string($job)) {
/** @var IJob $job */
$job = \OCP\Server::get($job);
diff --git a/tests/lib/BackgroundJob/TestJob.php b/tests/lib/BackgroundJob/TestJob.php
index 54b0ec7d9ea..a88132165ad 100644
--- a/tests/lib/BackgroundJob/TestJob.php
+++ b/tests/lib/BackgroundJob/TestJob.php
@@ -22,7 +22,7 @@ class TestJob extends \OCP\BackgroundJob\Job {
* @param JobTest $testCase
* @param callable $callback
*/
- public function __construct(ITimeFactory $time = null, $testCase = null, $callback = null) {
+ public function __construct(?ITimeFactory $time = null, $testCase = null, $callback = null) {
parent::__construct($time ?? \OCP\Server::get(ITimeFactory::class));
$this->testCase = $testCase;
$this->callback = $callback;
diff --git a/tests/lib/BackgroundJob/TestParallelAwareJob.php b/tests/lib/BackgroundJob/TestParallelAwareJob.php
index 7fa0bda7bbf..480762a2709 100644
--- a/tests/lib/BackgroundJob/TestParallelAwareJob.php
+++ b/tests/lib/BackgroundJob/TestParallelAwareJob.php
@@ -22,7 +22,7 @@ class TestParallelAwareJob extends \OCP\BackgroundJob\Job {
* @param JobTest $testCase
* @param callable $callback
*/
- public function __construct(ITimeFactory $time = null, $testCase = null, $callback = null) {
+ public function __construct(?ITimeFactory $time = null, $testCase = null, $callback = null) {
parent::__construct($time ?? \OC::$server->get(ITimeFactory::class));
$this->setAllowParallelRuns(false);
$this->testCase = $testCase;
diff --git a/tests/lib/Comments/FakeManager.php b/tests/lib/Comments/FakeManager.php
index b524f5a5000..136d32ce6c0 100644
--- a/tests/lib/Comments/FakeManager.php
+++ b/tests/lib/Comments/FakeManager.php
@@ -22,7 +22,7 @@ class FakeManager implements ICommentsManager {
$objectId,
$limit = 0,
$offset = 0,
- \DateTime $notOlderThan = null
+ ?\DateTime $notOlderThan = null
) {
}
@@ -49,7 +49,7 @@ class FakeManager implements ICommentsManager {
return [];
}
- public function getNumberOfCommentsForObject($objectType, $objectId, \DateTime $notOlderThan = null, $verb = '') {
+ public function getNumberOfCommentsForObject($objectType, $objectId, ?\DateTime $notOlderThan = null, $verb = '') {
}
public function search(string $search, string $objectType, string $objectId, string $verb, int $offset, int $limit = 50): array {
diff --git a/tests/lib/Files/ObjectStore/FailDeleteObjectStore.php b/tests/lib/Files/ObjectStore/FailDeleteObjectStore.php
index 5160abe574f..6613153f37f 100644
--- a/tests/lib/Files/ObjectStore/FailDeleteObjectStore.php
+++ b/tests/lib/Files/ObjectStore/FailDeleteObjectStore.php
@@ -40,7 +40,7 @@ class FailDeleteObjectStore implements IObjectStore {
return $this->objectStore->readObject($urn);
}
- public function writeObject($urn, $stream, string $mimetype = null) {
+ public function writeObject($urn, $stream, ?string $mimetype = null) {
return $this->objectStore->writeObject($urn, $stream, $mimetype);
}
diff --git a/tests/lib/Files/ObjectStore/FailWriteObjectStore.php b/tests/lib/Files/ObjectStore/FailWriteObjectStore.php
index 559d004cd0c..bcb9ef68890 100644
--- a/tests/lib/Files/ObjectStore/FailWriteObjectStore.php
+++ b/tests/lib/Files/ObjectStore/FailWriteObjectStore.php
@@ -40,7 +40,7 @@ class FailWriteObjectStore implements IObjectStore {
return $this->objectStore->readObject($urn);
}
- public function writeObject($urn, $stream, string $mimetype = null) {
+ public function writeObject($urn, $stream, ?string $mimetype = null) {
// emulate a failed write that didn't throw an error
return true;
}
diff --git a/tests/lib/Files/ObjectStore/S3Test.php b/tests/lib/Files/ObjectStore/S3Test.php
index c8333ca1ea3..7622f42676f 100644
--- a/tests/lib/Files/ObjectStore/S3Test.php
+++ b/tests/lib/Files/ObjectStore/S3Test.php
@@ -25,7 +25,7 @@ use Icewind\Streams\Wrapper;
use OC\Files\ObjectStore\S3;
class MultiPartUploadS3 extends S3 {
- public function writeObject($urn, $stream, string $mimetype = null) {
+ public function writeObject($urn, $stream, ?string $mimetype = null) {
$this->getConnection()->upload($this->bucket, $urn, $stream, 'private', [
'mup_threshold' => 1,
]);
diff --git a/tests/lib/L10N/FactoryTest.php b/tests/lib/L10N/FactoryTest.php
index 2db1e0302e8..20eb355f6f4 100644
--- a/tests/lib/L10N/FactoryTest.php
+++ b/tests/lib/L10N/FactoryTest.php
@@ -683,7 +683,7 @@ class FactoryTest extends TestCase {
/**
* @dataProvider languageIteratorRequestProvider
*/
- public function testGetLanguageIterator(bool $hasSession, IUser $iUserMock = null): void {
+ public function testGetLanguageIterator(bool $hasSession, ?IUser $iUserMock = null): void {
$factory = $this->getFactory();
if ($iUserMock === null) {
diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php
index 4ca00901762..59e1125d38f 100644
--- a/tests/lib/TestCase.php
+++ b/tests/lib/TestCase.php
@@ -525,7 +525,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
protected function IsDatabaseAccessAllowed() {
// on travis-ci.org we allow database access in any case - otherwise
// this will break all apps right away
- if (true == getenv('TRAVIS')) {
+ if (getenv('TRAVIS') == true) {
return true;
}
$annotations = $this->getGroupAnnotations();