diff options
-rw-r--r-- | lib/private/Migration/BackgroundRepair.php | 5 | ||||
-rw-r--r-- | tests/lib/Migration/BackgroundRepairTest.php | 5 |
2 files changed, 3 insertions, 7 deletions
diff --git a/lib/private/Migration/BackgroundRepair.php b/lib/private/Migration/BackgroundRepair.php index a873d23e7b2..7ef90301cf3 100644 --- a/lib/private/Migration/BackgroundRepair.php +++ b/lib/private/Migration/BackgroundRepair.php @@ -47,10 +47,7 @@ class BackgroundRepair extends TimedJob { /** @var EventDispatcherInterface */ private $dispatcher; - /** - * @param EventDispatcherInterface $dispatcher - */ - public function setDispatcher(EventDispatcherInterface $dispatcher): void { + public function __construct(EventDispatcherInterface $dispatcher) { $this->dispatcher = $dispatcher; } diff --git a/tests/lib/Migration/BackgroundRepairTest.php b/tests/lib/Migration/BackgroundRepairTest.php index 180ce72d315..df81fd45772 100644 --- a/tests/lib/Migration/BackgroundRepairTest.php +++ b/tests/lib/Migration/BackgroundRepairTest.php @@ -77,12 +77,11 @@ class BackgroundRepairTest extends TestCase { $this->logger = $this->getMockBuilder(ILogger::class) ->disableOriginalConstructor() ->getMock(); + $this->dispatcher = $this->createMock(EventDispatcherInterface::class); $this->job = $this->getMockBuilder(BackgroundRepair::class) + ->setConstructorArgs([$this->dispatcher]) ->setMethods(['loadApp']) ->getMock(); - - $this->dispatcher = $this->createMock(EventDispatcherInterface::class); - $this->job->setDispatcher($this->dispatcher); } public function testNoArguments() { |