aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-11-07 09:21:29 +0000
committerGitHub <noreply@github.com>2019-11-07 09:21:29 +0000
commit1f6b1fca57faede67134ecd186864ee1dae9aa8c (patch)
tree862745f68d01b134125ff4b41e998cd9582fe198
parent03d9e05bb518700083466fc2aaec6592280f7113 (diff)
parent4621a4202040b2a9dfe88d2e806ccaf167f06308 (diff)
downloadnextcloud-server-1f6b1fca57faede67134ecd186864ee1dae9aa8c.tar.gz
nextcloud-server-1f6b1fca57faede67134ecd186864ee1dae9aa8c.zip
Merge pull request #17835 from nextcloud/fix-background-scan-tests
fix tests for background file scan job
-rw-r--r--apps/files/tests/BackgroundJob/ScanFilesTest.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/apps/files/tests/BackgroundJob/ScanFilesTest.php b/apps/files/tests/BackgroundJob/ScanFilesTest.php
index 5b5557310d2..e558800b9de 100644
--- a/apps/files/tests/BackgroundJob/ScanFilesTest.php
+++ b/apps/files/tests/BackgroundJob/ScanFilesTest.php
@@ -59,6 +59,11 @@ class ScanFilesTest extends TestCase {
public function testRunWithoutUsers() {
$this->config
->expects($this->at(0))
+ ->method('getSystemValueBool')
+ ->with('files_no_background_scan', false)
+ ->will($this->returnValue(false));
+ $this->config
+ ->expects($this->at(1))
->method('getAppValue')
->with('files', 'cronjob_scan_files', 0)
->will($this->returnValue(50));
@@ -73,7 +78,7 @@ class ScanFilesTest extends TestCase {
->with('', 500)
->will($this->returnValue([]));
$this->config
- ->expects($this->at(1))
+ ->expects($this->at(2))
->method('setAppValue')
->with('files', 'cronjob_scan_files', 500);
@@ -84,6 +89,11 @@ class ScanFilesTest extends TestCase {
$fakeUser = $this->createMock(IUser::class);
$this->config
->expects($this->at(0))
+ ->method('getSystemValueBool')
+ ->with('files_no_background_scan', false)
+ ->will($this->returnValue(false));
+ $this->config
+ ->expects($this->at(1))
->method('getAppValue')
->with('files', 'cronjob_scan_files', 0)
->will($this->returnValue(50));
@@ -95,7 +105,7 @@ class ScanFilesTest extends TestCase {
$fakeUser
]));
$this->config
- ->expects($this->at(1))
+ ->expects($this->at(2))
->method('setAppValue')
->with('files', 'cronjob_scan_files', 550);
$this->scanFiles
@@ -109,6 +119,11 @@ class ScanFilesTest extends TestCase {
public function testRunWithUsersAndOffsetAtEndOfUserList() {
$this->config
->expects($this->at(0))
+ ->method('getSystemValueBool')
+ ->with('files_no_background_scan', false)
+ ->will($this->returnValue(false));
+ $this->config
+ ->expects($this->at(1))
->method('getAppValue')
->with('files', 'cronjob_scan_files', 0)
->will($this->returnValue(50));
@@ -123,7 +138,7 @@ class ScanFilesTest extends TestCase {
->with('', 500)
->will($this->returnValue([]));
$this->config
- ->expects($this->at(1))
+ ->expects($this->at(2))
->method('setAppValue')
->with('files', 'cronjob_scan_files', 500);
$this->scanFiles