mirror of
https://github.com/nextcloud/server.git
synced 2026-03-02 05:20:46 -05:00
Merge pull request #14805 from nextcloud/fix/backgroundrepair
Properly inject EventDispatched in BackgroundRepair
This commit is contained in:
commit
d94b56d5e4
2 changed files with 3 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue