\OC::$server->getConfig(),
\OC::$server->query(Installer::class)
),
- new RepairInvalidPaths(\OC::$server->getDatabaseConnection())
+ new RepairInvalidPaths(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig())
];
}
namespace OC\Repair\NC13;
+use OCP\IConfig;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
class RepairInvalidPaths implements IRepairStep {
/** @var IDBConnection */
private $connection;
+ /** @var IConfig */
+ private $config;
- public function __construct(IDBConnection $connection) {
+ public function __construct(IDBConnection $connection, IConfig $config) {
$this->connection = $connection;
+ $this->config = $config;
}
use OC\Files\Cache\Cache;
use OC\Files\Storage\Temporary;
-use OC\Repair\RepairInvalidPaths;
+use OC\Repair\NC13\RepairInvalidPaths;
+use OCP\IConfig;
use OCP\Migration\IOutput;
use Test\TestCase;
$this->storage = new Temporary();
$this->cache = $this->storage->getCache();
- $this->repair = new RepairInvalidPaths(\OC::$server->getDatabaseConnection());
+ $config = $this->createMock(IConfig::class);
+ $config->expects($this->any())
+ ->method('getSystemValue')
+ ->with('version', '0.0.0')
+ ->willReturn('12.0.0.0');
+ $this->repair = new RepairInvalidPaths(\OC::$server->getDatabaseConnection(), $config);
}
protected function tearDown() {