Merge pull request #17835 from nextcloud/fix-background-scan-tests
fix tests for background file scan job
This commit is contained in:
commit
1f6b1fca57
1 changed files with 18 additions and 3 deletions
|
@ -59,6 +59,11 @@ class ScanFilesTest extends TestCase {
|
||||||
public function testRunWithoutUsers() {
|
public function testRunWithoutUsers() {
|
||||||
$this->config
|
$this->config
|
||||||
->expects($this->at(0))
|
->expects($this->at(0))
|
||||||
|
->method('getSystemValueBool')
|
||||||
|
->with('files_no_background_scan', false)
|
||||||
|
->will($this->returnValue(false));
|
||||||
|
$this->config
|
||||||
|
->expects($this->at(1))
|
||||||
->method('getAppValue')
|
->method('getAppValue')
|
||||||
->with('files', 'cronjob_scan_files', 0)
|
->with('files', 'cronjob_scan_files', 0)
|
||||||
->will($this->returnValue(50));
|
->will($this->returnValue(50));
|
||||||
|
@ -73,7 +78,7 @@ class ScanFilesTest extends TestCase {
|
||||||
->with('', 500)
|
->with('', 500)
|
||||||
->will($this->returnValue([]));
|
->will($this->returnValue([]));
|
||||||
$this->config
|
$this->config
|
||||||
->expects($this->at(1))
|
->expects($this->at(2))
|
||||||
->method('setAppValue')
|
->method('setAppValue')
|
||||||
->with('files', 'cronjob_scan_files', 500);
|
->with('files', 'cronjob_scan_files', 500);
|
||||||
|
|
||||||
|
@ -84,6 +89,11 @@ class ScanFilesTest extends TestCase {
|
||||||
$fakeUser = $this->createMock(IUser::class);
|
$fakeUser = $this->createMock(IUser::class);
|
||||||
$this->config
|
$this->config
|
||||||
->expects($this->at(0))
|
->expects($this->at(0))
|
||||||
|
->method('getSystemValueBool')
|
||||||
|
->with('files_no_background_scan', false)
|
||||||
|
->will($this->returnValue(false));
|
||||||
|
$this->config
|
||||||
|
->expects($this->at(1))
|
||||||
->method('getAppValue')
|
->method('getAppValue')
|
||||||
->with('files', 'cronjob_scan_files', 0)
|
->with('files', 'cronjob_scan_files', 0)
|
||||||
->will($this->returnValue(50));
|
->will($this->returnValue(50));
|
||||||
|
@ -95,7 +105,7 @@ class ScanFilesTest extends TestCase {
|
||||||
$fakeUser
|
$fakeUser
|
||||||
]));
|
]));
|
||||||
$this->config
|
$this->config
|
||||||
->expects($this->at(1))
|
->expects($this->at(2))
|
||||||
->method('setAppValue')
|
->method('setAppValue')
|
||||||
->with('files', 'cronjob_scan_files', 550);
|
->with('files', 'cronjob_scan_files', 550);
|
||||||
$this->scanFiles
|
$this->scanFiles
|
||||||
|
@ -109,6 +119,11 @@ class ScanFilesTest extends TestCase {
|
||||||
public function testRunWithUsersAndOffsetAtEndOfUserList() {
|
public function testRunWithUsersAndOffsetAtEndOfUserList() {
|
||||||
$this->config
|
$this->config
|
||||||
->expects($this->at(0))
|
->expects($this->at(0))
|
||||||
|
->method('getSystemValueBool')
|
||||||
|
->with('files_no_background_scan', false)
|
||||||
|
->will($this->returnValue(false));
|
||||||
|
$this->config
|
||||||
|
->expects($this->at(1))
|
||||||
->method('getAppValue')
|
->method('getAppValue')
|
||||||
->with('files', 'cronjob_scan_files', 0)
|
->with('files', 'cronjob_scan_files', 0)
|
||||||
->will($this->returnValue(50));
|
->will($this->returnValue(50));
|
||||||
|
@ -123,7 +138,7 @@ class ScanFilesTest extends TestCase {
|
||||||
->with('', 500)
|
->with('', 500)
|
||||||
->will($this->returnValue([]));
|
->will($this->returnValue([]));
|
||||||
$this->config
|
$this->config
|
||||||
->expects($this->at(1))
|
->expects($this->at(2))
|
||||||
->method('setAppValue')
|
->method('setAppValue')
|
||||||
->with('files', 'cronjob_scan_files', 500);
|
->with('files', 'cronjob_scan_files', 500);
|
||||||
$this->scanFiles
|
$this->scanFiles
|
||||||
|
|
Loading…
Reference in a new issue