aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/repair
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-03-11 13:32:33 +0100
committerMorris Jobke <hey@morrisjobke.de>2015-03-11 13:32:33 +0100
commitad97ceb787ed859e01305d350acce2739d36be53 (patch)
treec2ca0f433007d1d242e8f39152a293bc574720c0 /tests/lib/repair
parent8154ed4d2c924e134b4d1d6fa8cdd13b311cc75a (diff)
parent1750e7b76d9e625bb94c5599bb6fa713a3441bfc (diff)
downloadnextcloud-server-ad97ceb787ed859e01305d350acce2739d36be53.tar.gz
nextcloud-server-ad97ceb787ed859e01305d350acce2739d36be53.zip
Merge pull request #13513 from owncloud/repair-legacystoragenofatalfail
Do not abort when meeting unfixable legacy storages
Diffstat (limited to 'tests/lib/repair')
-rw-r--r--tests/lib/repair/repairlegacystorage.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/lib/repair/repairlegacystorage.php b/tests/lib/repair/repairlegacystorage.php
index f08393300e1..4167ddff85a 100644
--- a/tests/lib/repair/repairlegacystorage.php
+++ b/tests/lib/repair/repairlegacystorage.php
@@ -24,6 +24,8 @@ class TestRepairLegacyStorages extends \Test\TestCase {
private $legacyStorageId;
private $newStorageId;
+ private $warnings;
+
protected function setUp() {
parent::setUp();
@@ -32,6 +34,12 @@ class TestRepairLegacyStorages extends \Test\TestCase {
$this->oldDataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data/');
$this->repair = new \OC\Repair\RepairLegacyStorages($this->config, $this->connection);
+
+ $this->warnings = [];
+
+ $this->repair->listen('\OC\Repair', 'warning', function ($description){
+ $this->warnings[] = $description;
+ });
}
protected function tearDown() {
@@ -181,21 +189,16 @@ class TestRepairLegacyStorages extends \Test\TestCase {
$this->createData($this->legacyStorageId);
$this->createData($this->newStorageId);
- try {
- $thrown = false;
- $this->repair->run();
- }
- catch (\OC\RepairException $e) {
- $thrown = true;
- }
+ $this->repair->run();
- $this->assertTrue($thrown);
+ $this->assertEquals(2, count($this->warnings));
+ $this->assertEquals('Could not repair legacy storage ', substr(current($this->warnings), 0, 32));
// storages left alone
$this->assertEquals($legacyStorageNumId, $this->getStorageId($this->legacyStorageId));
$this->assertEquals($newStorageNumId, $this->getStorageId($this->newStorageId));
- // did not set the done flag
+ // do not set the done flag
$this->assertNotEquals('yes', $this->config->getAppValue('core', 'repairlegacystoragesdone'));
}