adjust to moved repair step

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2017-06-29 14:45:08 +02:00
parent daa2c86965
commit f01bd935ed
No known key found for this signature in database
GPG Key ID: CBCA68FBAEBF98C9
3 changed files with 14 additions and 4 deletions

View File

@ -164,7 +164,7 @@ class Repair implements IOutput{
\OC::$server->getConfig()
),
new FixMountStorages(\OC::$server->getDatabaseConnection()),
new RepairInvalidPaths(\OC::$server->getDatabaseConnection())
new RepairInvalidPaths(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig())
];
}

View File

@ -22,6 +22,7 @@
namespace OC\Repair\NC13;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
@ -29,9 +30,12 @@ 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;
}

View File

@ -23,7 +23,8 @@ namespace Test\Repair;
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;
@ -43,7 +44,12 @@ class RepairInvalidPathsTest extends 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() {