aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Migration/BackgroundRepairTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Migration/BackgroundRepairTest.php')
-rw-r--r--tests/lib/Migration/BackgroundRepairTest.php33
1 files changed, 13 insertions, 20 deletions
diff --git a/tests/lib/Migration/BackgroundRepairTest.php b/tests/lib/Migration/BackgroundRepairTest.php
index 2e68924a96d..95cd5419f30 100644
--- a/tests/lib/Migration/BackgroundRepairTest.php
+++ b/tests/lib/Migration/BackgroundRepairTest.php
@@ -21,15 +21,15 @@
namespace Test\Migration;
-use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\EventDispatcher\IEventDispatcher;
-use OCP\Migration\IOutput;
-use OCP\Migration\IRepairStep;
use OC\BackgroundJob\JobList;
use OC\Migration\BackgroundRepair;
use OC\NeedsUpdateException;
+use OC\Repair;
use OC\Repair\Events\RepairStepEvent;
-use PHPUnit\Framework\MockObject\MockObject;
+use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\EventDispatcher\IEventDispatcher;
+use OCP\Migration\IOutput;
+use OCP\Migration\IRepairStep;
use Psr\Log\LoggerInterface;
use Test\TestCase;
@@ -57,20 +57,12 @@ class TestRepairStep implements IRepairStep {
}
class BackgroundRepairTest extends TestCase {
- /** @var JobList|MockObject */
- private $jobList;
-
- /** @var BackgroundRepair|MockObject */
- private $job;
-
- /** @var LoggerInterface|MockObject */
- private $logger;
-
- /** @var IEventDispatcher|MockObject $dispatcher */
- private $dispatcher;
-
- /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject $dispatcher */
- private $time;
+ private JobList $jobList;
+ private BackgroundRepair $job;
+ private LoggerInterface $logger;
+ private IEventDispatcher $dispatcher;
+ private ITimeFactory $time;
+ private Repair $repair;
protected function setUp(): void {
parent::setUp();
@@ -85,8 +77,9 @@ class BackgroundRepairTest extends TestCase {
$this->time = $this->createMock(ITimeFactory::class);
$this->time->method('getTime')
->willReturn(999999);
+ $this->repair = new Repair($this->dispatcher, $this->logger);
$this->job = $this->getMockBuilder(BackgroundRepair::class)
- ->setConstructorArgs([$this->dispatcher, $this->time, $this->logger, $this->jobList])
+ ->setConstructorArgs([$this->repair, $this->time, $this->logger, $this->jobList])
->setMethods(['loadApp'])
->getMock();
}