|
|
|
@ -24,12 +24,12 @@ namespace Test\Migration;
|
|
|
|
|
use OC\BackgroundJob\JobList;
|
|
|
|
|
use OC\Migration\BackgroundRepair;
|
|
|
|
|
use OC\NeedsUpdateException;
|
|
|
|
|
use OC\Repair;
|
|
|
|
|
use OC\Repair\Events\RepairStepEvent;
|
|
|
|
|
use OCP\AppFramework\Utility\ITimeFactory;
|
|
|
|
|
use OCP\EventDispatcher\IEventDispatcher;
|
|
|
|
|
use OCP\Migration\IOutput;
|
|
|
|
|
use OCP\Migration\IRepairStep;
|
|
|
|
|
use PHPUnit\Framework\MockObject\MockObject;
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|