aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-06-29 14:45:08 +0200
committerRobin Appelman <robin@icewind.nl>2017-07-13 13:08:23 +0200
commit64d0a0ffc96f1fac81c51d0cbb2eb59f51d93a1b (patch)
treedc26df4ab053c0fe5855f2281f4ec752c7b831ed
parentd422875ae4e5e6afc425367d2ff710074fd154a6 (diff)
downloadnextcloud-server-64d0a0ffc96f1fac81c51d0cbb2eb59f51d93a1b.tar.gz
nextcloud-server-64d0a0ffc96f1fac81c51d0cbb2eb59f51d93a1b.zip
adjust to moved repair step
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--lib/private/Repair.php2
-rw-r--r--lib/private/Repair/NC13/RepairInvalidPaths.php6
-rw-r--r--tests/lib/Repair/RepairInvalidPathsTest.php10
3 files changed, 14 insertions, 4 deletions
diff --git a/lib/private/Repair.php b/lib/private/Repair.php
index 65b131169f7..dae328e6340 100644
--- a/lib/private/Repair.php
+++ b/lib/private/Repair.php
@@ -145,7 +145,7 @@ class Repair implements IOutput{
\OC::$server->getConfig(),
\OC::$server->query(Installer::class)
),
- new RepairInvalidPaths(\OC::$server->getDatabaseConnection())
+ new RepairInvalidPaths(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig())
];
}
diff --git a/lib/private/Repair/NC13/RepairInvalidPaths.php b/lib/private/Repair/NC13/RepairInvalidPaths.php
index 8551f8261e2..076fbb735c8 100644
--- a/lib/private/Repair/NC13/RepairInvalidPaths.php
+++ b/lib/private/Repair/NC13/RepairInvalidPaths.php
@@ -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;
}
diff --git a/tests/lib/Repair/RepairInvalidPathsTest.php b/tests/lib/Repair/RepairInvalidPathsTest.php
index c6c1bbb19bc..b18758585c1 100644
--- a/tests/lib/Repair/RepairInvalidPathsTest.php
+++ b/tests/lib/Repair/RepairInvalidPathsTest.php
@@ -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() {