]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix willReturnOnConsecutiveCalls 19933/head
authorJoas Schilling <coding@schilljs.com>
Fri, 13 Mar 2020 10:11:00 +0000 (11:11 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 13 Mar 2020 14:53:09 +0000 (14:53 +0000)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/files_sharing/lib/Controller/ExternalSharesController.php
apps/files_sharing/tests/Controller/ExternalShareControllerTest.php

index f903871ffd6adf5cdab819129078a80547941e7b..122ad0f7cf473be89e402383e9eb5839942fd1a2 100644 (file)
@@ -133,6 +133,7 @@ class ExternalSharesController extends Controller {
                if (strpos($remote, '#') !== false || strpos($remote, '?') !== false) {
                        return new DataResponse(false);
                }
+
                if (
                        $this->testUrl('https://' . $remote . '/ocs-provider/') ||
                        $this->testUrl('https://' . $remote . '/ocs-provider/index.php') ||
index 9ef508a3d0a327486dcb8a2fc1a5c91a859aaf7c..9d8ee9a9d4217a98db535f9237f34c0ecaa0f952 100644 (file)
@@ -99,8 +99,8 @@ class ExternalShareControllerTest extends \Test\TestCase {
                        ->expects($this->exactly(2))
                        ->method('getBody')
                        ->willReturnOnConsecutiveCalls(
-                               ['Certainly not a JSON string'],
-                               ['{"installed":true,"maintenance":false,"version":"8.1.0.8","versionstring":"8.1.0","edition":""}']
+                               'Certainly not a JSON string',
+                               '{"installed":true,"maintenance":false,"version":"8.1.0.8","versionstring":"8.1.0","edition":""}'
                        );
                $client
                        ->expects($this->any())
@@ -124,7 +124,13 @@ class ExternalShareControllerTest extends \Test\TestCase {
                $response
                        ->expects($this->exactly(5))
                        ->method('getBody')
-                       ->will($this->onConsecutiveCalls('Certainly not a JSON string', 'Certainly not a JSON string', 'Certainly not a JSON string', 'Certainly not a JSON string', '{"installed":true,"maintenance":false,"version":"8.1.0.8","versionstring":"8.1.0","edition":""}'));
+                       ->willReturnOnConsecutiveCalls(
+                               'Certainly not a JSON string',
+                               'Certainly not a JSON string',
+                               'Certainly not a JSON string',
+                               'Certainly not a JSON string',
+                               '{"installed":true,"maintenance":false,"version":"8.1.0.8","versionstring":"8.1.0","edition":""}'
+                       );
                $this->clientService
                        ->expects($this->exactly(5))
                        ->method('newClient')