diff options
author | Joas Schilling <coding@schilljs.com> | 2016-09-26 13:59:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-26 13:59:28 +0200 |
commit | fc6509369432dba2df588348cfafb59208e1d4a4 (patch) | |
tree | 9d4b1453c77d7524beba7b6fcb4172226379bf11 | |
parent | 4f4286932f000d1de6c4728a395a1826772ae24a (diff) | |
parent | 118c9d58fe44788bb2b0b684ac1209c23f847ff6 (diff) | |
download | nextcloud-server-fc6509369432dba2df588348cfafb59208e1d4a4.tar.gz nextcloud-server-fc6509369432dba2df588348cfafb59208e1d4a4.zip |
Merge pull request #1460 from nextcloud/fed-share-retry
[upstream] Fix fed share test call to return proper result
-rw-r--r-- | apps/files_sharing/lib/External/Storage.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/ExternalStorageTest.php | 28 |
2 files changed, 23 insertions, 7 deletions
diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php index 1ed6375cd4f..caa2bcf2a79 100644 --- a/apps/files_sharing/lib/External/Storage.php +++ b/apps/files_sharing/lib/External/Storage.php @@ -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(); diff --git a/apps/files_sharing/tests/ExternalStorageTest.php b/apps/files_sharing/tests/ExternalStorageTest.php index 48c348667c5..e84d2bb0e17 100644 --- a/apps/files_sharing/tests/ExternalStorageTest.php +++ b/apps/files_sharing/tests/ExternalStorageTest.php @@ -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); + } } |