diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-09-06 12:57:14 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-09-20 12:11:26 +0200 |
commit | 118c9d58fe44788bb2b0b684ac1209c23f847ff6 (patch) | |
tree | b2cde8e11e9dc39f093b5a4b3a8fbc58e13feedb /apps/files_sharing/tests/ExternalStorageTest.php | |
parent | 09e1218df939ffb28160d054bed28af8fc29113e (diff) | |
download | nextcloud-server-118c9d58fe44788bb2b0b684ac1209c23f847ff6.tar.gz nextcloud-server-118c9d58fe44788bb2b0b684ac1209c23f847ff6.zip |
Fix fed share test call to return proper result
Fixes an issue where retrying a previously failed federated share would
not properly reset the availability flag because the return value was
undefined instead of "true".
Diffstat (limited to 'apps/files_sharing/tests/ExternalStorageTest.php')
-rw-r--r-- | apps/files_sharing/tests/ExternalStorageTest.php | 28 |
1 files changed, 22 insertions, 6 deletions
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); + } } |