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
diff options
context:
space:
mode:
-rw-r--r--apps/files_sharing/lib/External/Storage.php2
-rw-r--r--apps/files_sharing/tests/ExternalStorageTest.php28
-rw-r--r--lib/base.php6
3 files changed, 29 insertions, 7 deletions
diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php
index bc8d898f8ef..2344f6cf132 100644
--- a/apps/files_sharing/lib/External/Storage.php
+++ b/apps/files_sharing/lib/External/Storage.php
@@ -184,7 +184,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 c5ff4ad0236..af8cde10042 100644
--- a/apps/files_sharing/tests/ExternalStorageTest.php
+++ b/apps/files_sharing/tests/ExternalStorageTest.php
@@ -66,14 +66,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',
@@ -82,8 +79,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);
+ }
}
/**
@@ -94,4 +103,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);
+ }
}
diff --git a/lib/base.php b/lib/base.php
index 1f3079b039e..9d0b1219f54 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -890,6 +890,12 @@ class OC {
OC_Util::setupFS();
OC::$server->getRouter()->match(\OC::$server->getRequest()->getRawPathInfo());
return;
+ } catch (\OC\NeedsUpdateException $e) {
+ if ($isOccControllerRequested && $needUpgrade){
+ OC::$server->getRouter()->match(\OC::$server->getRequest()->getRawPathInfo());
+ return;
+ }
+ throw $e;
} catch (Symfony\Component\Routing\Exception\ResourceNotFoundException $e) {
//header('HTTP/1.0 404 Not Found');
} catch (Symfony\Component\Routing\Exception\MethodNotAllowedException $e) {