aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests/Jobs/CleanUpTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/tests/Jobs/CleanUpTest.php')
-rw-r--r--apps/user_ldap/tests/Jobs/CleanUpTest.php23
1 files changed, 11 insertions, 12 deletions
diff --git a/apps/user_ldap/tests/Jobs/CleanUpTest.php b/apps/user_ldap/tests/Jobs/CleanUpTest.php
index 05d202f82df..5a1e563a1e8 100644
--- a/apps/user_ldap/tests/Jobs/CleanUpTest.php
+++ b/apps/user_ldap/tests/Jobs/CleanUpTest.php
@@ -1,5 +1,6 @@
<?php
+declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -18,13 +19,11 @@ use OCP\IDBConnection;
use Test\TestCase;
class CleanUpTest extends TestCase {
- /** @var CleanUp */
- protected $bgJob;
-
- /** @var array */
- protected $mocks;
+ protected CleanUp $bgJob;
+ protected array $mocks;
public function setUp(): void {
+ parent::setUp();
$this->createMocks();
$this->bgJob = new CleanUp($this->mocks['timeFactory'], $this->mocks['userBackend'], $this->mocks['deletedUsersIndex']);
$this->bgJob->setArguments($this->mocks);
@@ -43,7 +42,7 @@ class CleanUpTest extends TestCase {
/**
* clean up job must not run when there are disabled configurations
*/
- public function test_runNotAllowedByDisabledConfigurations() {
+ public function test_runNotAllowedByDisabledConfigurations(): void {
$this->mocks['helper']->expects($this->once())
->method('haveDisabledConfigurations')
->willReturn(true);
@@ -59,10 +58,10 @@ class CleanUpTest extends TestCase {
* clean up job must not run when LDAP Helper is broken i.e.
* returning unexpected results
*/
- public function test_runNotAllowedByBrokenHelper() {
+ public function test_runNotAllowedByBrokenHelper(): void {
$this->mocks['helper']->expects($this->once())
->method('haveDisabledConfigurations')
- ->will($this->throwException(new Exception()));
+ ->willThrowException(new Exception());
$this->mocks['ocConfig']->expects($this->never())
->method('getSystemValue');
@@ -74,7 +73,7 @@ class CleanUpTest extends TestCase {
/**
* clean up job must not run when it is not enabled
*/
- public function test_runNotAllowedBySysConfig() {
+ public function test_runNotAllowedBySysConfig(): void {
$this->mocks['helper']->expects($this->once())
->method('haveDisabledConfigurations')
->willReturn(false);
@@ -90,7 +89,7 @@ class CleanUpTest extends TestCase {
/**
* clean up job is allowed to run
*/
- public function test_runIsAllowed() {
+ public function test_runIsAllowed(): void {
$this->mocks['helper']->expects($this->once())
->method('haveDisabledConfigurations')
->willReturn(false);
@@ -106,7 +105,7 @@ class CleanUpTest extends TestCase {
/**
* check whether offset will be reset when it needs to
*/
- public function test_OffsetResetIsNecessary() {
+ public function test_OffsetResetIsNecessary(): void {
$result = $this->bgJob->isOffsetResetNecessary($this->bgJob->getChunkSize() - 1);
$this->assertSame(true, $result);
}
@@ -114,7 +113,7 @@ class CleanUpTest extends TestCase {
/**
* make sure offset is not reset when it is not due
*/
- public function test_OffsetResetIsNotNecessary() {
+ public function test_OffsetResetIsNotNecessary(): void {
$result = $this->bgJob->isOffsetResetNecessary($this->bgJob->getChunkSize());
$this->assertSame(false, $result);
}