aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/BackgroundJob/JobTest.php
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2024-02-08 15:31:19 +0100
committerLouis Chemineau <louis@chmn.me>2024-02-08 15:31:19 +0100
commit898df41de968321926e10ad532a64c3915ddad29 (patch)
tree57a0e5ada151890ddf71550f22b502e1f67aeffd /tests/lib/BackgroundJob/JobTest.php
parentd9d60238c7aaab9c61bf2d50c15aa59bc88c8975 (diff)
downloadnextcloud-server-898df41de968321926e10ad532a64c3915ddad29.tar.gz
nextcloud-server-898df41de968321926e10ad532a64c3915ddad29.zip
Revert "Merge branch 'master' of github.com:nextcloud/server"
This reverts commit d9d60238c7aaab9c61bf2d50c15aa59bc88c8975, reversing changes made to ba3fdb0cdcfbb84f0080a2146a4ba2f01569915d.
Diffstat (limited to 'tests/lib/BackgroundJob/JobTest.php')
-rw-r--r--tests/lib/BackgroundJob/JobTest.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/lib/BackgroundJob/JobTest.php b/tests/lib/BackgroundJob/JobTest.php
index c3a4a7d0552..a4e0dcf4fd6 100644
--- a/tests/lib/BackgroundJob/JobTest.php
+++ b/tests/lib/BackgroundJob/JobTest.php
@@ -9,20 +9,16 @@
namespace Test\BackgroundJob;
use OCP\AppFramework\Utility\ITimeFactory;
-use Psr\Log\LoggerInterface;
+use OCP\ILogger;
class JobTest extends \Test\TestCase {
private $run = false;
private ITimeFactory $timeFactory;
- private LoggerInterface $logger;
protected function setUp(): void {
parent::setUp();
$this->run = false;
- $this->timeFactory = \OCP\Server::get(ITimeFactory::class);
- $this->logger = $this->createMock(LoggerInterface::class);
-
- \OC::$server->registerService(LoggerInterface::class, fn ($c) => $this->logger);
+ $this->timeFactory = \OC::$server->get(ITimeFactory::class);
}
public function testRemoveAfterException() {
@@ -33,11 +29,14 @@ class JobTest extends \Test\TestCase {
});
$jobList->add($job);
- $this->logger->expects($this->once())
+ $logger = $this->getMockBuilder(ILogger::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $logger->expects($this->once())
->method('error');
$this->assertCount(1, $jobList->getAll());
- $job->start($jobList);
+ $job->execute($jobList, $logger);
$this->assertTrue($this->run);
$this->assertCount(1, $jobList->getAll());
}
@@ -50,11 +49,14 @@ class JobTest extends \Test\TestCase {
});
$jobList->add($job);
- $this->logger->expects($this->once())
+ $logger = $this->getMockBuilder(ILogger::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $logger->expects($this->once())
->method('error');
$this->assertCount(1, $jobList->getAll());
- $job->start($jobList);
+ $job->execute($jobList, $logger);
$this->assertTrue($this->run);
$this->assertCount(1, $jobList->getAll());
}