summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/backgroundjob/job.php1
-rw-r--r--tests/lib/backgroundjob/job.php11
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/backgroundjob/job.php b/lib/private/backgroundjob/job.php
index 88682cd09bb..40a27491fe6 100644
--- a/lib/private/backgroundjob/job.php
+++ b/lib/private/backgroundjob/job.php
@@ -54,7 +54,6 @@ abstract class Job implements IJob {
if ($logger) {
$logger->error('Error while running background job: ' . $e->getMessage());
}
- $jobList->remove($this, $this->argument);
}
}
diff --git a/tests/lib/backgroundjob/job.php b/tests/lib/backgroundjob/job.php
index fec9b0a792d..912e0e13b57 100644
--- a/tests/lib/backgroundjob/job.php
+++ b/tests/lib/backgroundjob/job.php
@@ -23,10 +23,17 @@ class Job extends \Test\TestCase {
});
$jobList->add($job);
+ $logger = $this->getMockBuilder('OCP\ILogger')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $logger->expects($this->once())
+ ->method('error')
+ ->with('Error while running background job: ');
+
$this->assertCount(1, $jobList->getAll());
- $job->execute($jobList);
+ $job->execute($jobList, $logger);
$this->assertTrue($this->run);
- $this->assertCount(0, $jobList->getAll());
+ $this->assertCount(1, $jobList->getAll());
}
public function markRun() {