]> source.dussan.org Git - nextcloud-server.git/commitdiff
adjust to moved repair step
authorRobin Appelman <robin@icewind.nl>
Thu, 29 Jun 2017 12:45:08 +0000 (14:45 +0200)
committerRobin Appelman <robin@icewind.nl>
Thu, 13 Jul 2017 11:08:23 +0000 (13:08 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Repair.php
lib/private/Repair/NC13/RepairInvalidPaths.php
tests/lib/Repair/RepairInvalidPathsTest.php

index 65b131169f70129a9b34c2562a6c22090012e611..dae328e6340b66ef50fcd7b0f85badf899724907 100644 (file)
@@ -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())
                ];
        }
 
index 8551f8261e2179182a2b81610704ce408258069d..076fbb735c8ee605d458614cc34fed5029c73880 100644 (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;
        }
 
 
index c6c1bbb19bc9e8b0b57c903fd48fde9c7467a15c..b18758585c19b7ffa1dae97f5fccee8a95b2bc4b 100644 (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() {