diff options
Diffstat (limited to 'tests/lib/backgroundjob/job.php')
-rw-r--r-- | tests/lib/backgroundjob/job.php | 10 |
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); |