Merge pull request #1515 from nextcloud/stable9.1-fed-share-retry

[stable10] Fix fed share test call to return proper result
This commit is contained in:
Morris Jobke 2016-09-28 22:02:29 +02:00 committed by GitHub
commit 7841f9775f
2 changed files with 23 additions and 7 deletions

View File

@ -186,7 +186,7 @@ class Storage extends DAV implements ISharedStorage {
public function test() {
try {
parent::test();
return parent::test();
} catch (StorageInvalidException $e) {
// check if it needs to be removed
$this->checkStorageAvailability();

View File

@ -67,14 +67,11 @@ class ExternalStorageTest extends \Test\TestCase {
);
}
/**
* @dataProvider optionsProvider
*/
public function testStorageMountOptions($inputUri, $baseUri) {
private function getTestStorage($uri) {
$certificateManager = \OC::$server->getCertificateManager();
$storage = new TestSharingExternalStorage(
return new TestSharingExternalStorage(
array(
'remote' => $inputUri,
'remote' => $uri,
'owner' => 'testOwner',
'mountpoint' => 'remoteshare',
'token' => 'abcdef',
@ -83,8 +80,20 @@ class ExternalStorageTest extends \Test\TestCase {
'certificateManager' => $certificateManager
)
);
}
/**
* @dataProvider optionsProvider
*/
public function testStorageMountOptions($inputUri, $baseUri) {
$storage = $this->getTestStorage($inputUri);
$this->assertEquals($baseUri, $storage->getBaseUri());
}
public function testIfTestReturnsTheValue() {
$result = $this->getTestStorage('https://remoteserver')->test();
$this->assertSame(true, $result);
}
}
/**
@ -95,4 +104,11 @@ class TestSharingExternalStorage extends \OCA\Files_Sharing\External\Storage {
public function getBaseUri() {
return $this->createBaseUri();
}
public function stat($path) {
if ($path === '') {
return true;
}
return parent::stat($path);
}
}