Skip to content

Commit

Permalink
adjust to moved repair step
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Jul 13, 2017
1 parent d422875 commit 64d0a0f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/private/Repair.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public static function getRepairSteps() {
\OC::$server->getConfig(),
\OC::$server->query(Installer::class)
),
new RepairInvalidPaths(\OC::$server->getDatabaseConnection())
new RepairInvalidPaths(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig())
];
}

Expand Down
6 changes: 5 additions & 1 deletion lib/private/Repair/NC13/RepairInvalidPaths.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@
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;
}


Expand Down
10 changes: 8 additions & 2 deletions tests/lib/Repair/RepairInvalidPathsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

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;

Expand All @@ -43,7 +44,12 @@ protected function setUp() {

$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() {
Expand Down

0 comments on commit 64d0a0f

Please sign in to comment.