aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/backgroundjob
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-01-14 10:38:53 +0100
committerMorris Jobke <hey@morrisjobke.de>2016-01-14 10:40:23 +0100
commit86f08f59d6318a45a20b74e4b2b449ddc6882419 (patch)
tree2ea3cf84cdc6596110144a14976243839926b2e6 /tests/lib/backgroundjob
parent64c8427d813445aceb019c08a417633ace17d366 (diff)
downloadnextcloud-server-86f08f59d6318a45a20b74e4b2b449ddc6882419.tar.gz
nextcloud-server-86f08f59d6318a45a20b74e4b2b449ddc6882419.zip
use logException() to properly log the exception
Diffstat (limited to 'tests/lib/backgroundjob')
-rw-r--r--tests/lib/backgroundjob/job.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/lib/backgroundjob/job.php b/tests/lib/backgroundjob/job.php
index f2a5ff894fe..75b4865819a 100644
--- a/tests/lib/backgroundjob/job.php
+++ b/tests/lib/backgroundjob/job.php
@@ -18,8 +18,9 @@ class Job extends \Test\TestCase {
public function testRemoveAfterException() {
$jobList = new DummyJobList();
- $job = new TestJob($this, function () {
- throw new \Exception();
+ $e = new \Exception();
+ $job = new TestJob($this, function () use ($e) {
+ throw $e;
});
$jobList->add($job);
@@ -28,7 +29,10 @@ class Job extends \Test\TestCase {
->getMock();
$logger->expects($this->once())
->method('error')
- ->with('Error while running background job (class: Test\BackgroundJob\TestJob, arguments: ): ');
+ ->with('Error while running background job (class: Test\BackgroundJob\TestJob, arguments: )');
+ $logger->expects($this->once())
+ ->method('logException')
+ ->with($e);
$this->assertCount(1, $jobList->getAll());
$job->execute($jobList, $logger);