diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-11-14 20:20:20 +0100 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2017-11-14 20:26:18 +0100 |
commit | a923e755e67e0e14dee824877afa9e6425b38379 (patch) | |
tree | 2e89139d3a9e075cde3698eb29c12ec167769f80 /tests | |
parent | a3f86b99e95ca71799df5f08b18ceb7e77f82b66 (diff) | |
download | nextcloud-server-a923e755e67e0e14dee824877afa9e6425b38379.tar.gz nextcloud-server-a923e755e67e0e14dee824877afa9e6425b38379.zip |
check if the user still exists before we try to cleanup the previews
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Repair/NC11/CleanPreviewsBackgroundJobTest.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/lib/Repair/NC11/CleanPreviewsBackgroundJobTest.php b/tests/lib/Repair/NC11/CleanPreviewsBackgroundJobTest.php index e3fb22f0825..c0e2f0ce1b5 100644 --- a/tests/lib/Repair/NC11/CleanPreviewsBackgroundJobTest.php +++ b/tests/lib/Repair/NC11/CleanPreviewsBackgroundJobTest.php @@ -30,6 +30,7 @@ use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; use OCP\ILogger; +use OCP\IUserManager; use Test\TestCase; class CleanPreviewsBackgroundJobTest extends TestCase { @@ -48,6 +49,9 @@ class CleanPreviewsBackgroundJobTest extends TestCase { /** @var CleanPreviewsBackgroundJob */ private $job; + /** @var IUserManager|\PHPUnit_Framework_MockObject_MockObject */ + private $userManager; + public function setUp() { parent::setUp(); @@ -55,12 +59,17 @@ class CleanPreviewsBackgroundJobTest extends TestCase { $this->logger = $this->createMock(ILogger::class); $this->jobList = $this->createMock(IJobList::class); $this->timeFactory = $this->createMock(ITimeFactory::class); + $this->userManager = $this->createMock(IUserManager::class); + + $this->userManager->expects($this->any())->method('userExists')->willReturn(true); $this->job = new CleanPreviewsBackgroundJob( $this->rootFolder, $this->logger, $this->jobList, - $this->timeFactory); + $this->timeFactory, + $this->userManager + ); } public function testCleanupPreviewsUnfinished() { |