Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-01-20 16:25:07 +0300
committerVincent Petry <pvince81@owncloud.com>2015-03-16 18:25:21 +0300
commit5538c2732276e2d1d4b30faf475b41a1e8e3681d (patch)
tree2b8bd81253e4f95956d790bccd0eb008c58c90a2 /tests
parent35abb4d71e049c2c7b244ac346c7f1b9e455d20c (diff)
Do not abort when meeting unfixable legacy storages
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/repair/repairlegacystorage.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/tests/lib/repair/repairlegacystorage.php b/tests/lib/repair/repairlegacystorage.php
index f08393300e1..24f2dbe13c0 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,22 +189,17 @@ 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(1, 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
- $this->assertNotEquals('yes', $this->config->getAppValue('core', 'repairlegacystoragesdone'));
+ // set the done flag
+ $this->assertEquals('yes', $this->config->getAppValue('core', 'repairlegacystoragesdone'));
}
/**