aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-03-07 18:38:39 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2024-03-13 12:49:52 +0100
commit1fffdf4763c04a04ba5defb53d6df451fe2a75f9 (patch)
tree0c2621f0e6f9b5d19ccee23caf7d62308b0cc6cf /apps
parenta47a1e6249f97765d7f899c8dfb9b44c76b0d542 (diff)
downloadnextcloud-server-1fffdf4763c04a04ba5defb53d6df451fe2a75f9.tar.gz
nextcloud-server-1fffdf4763c04a04ba5defb53d6df451fe2a75f9.zip
fix: Fix ocm-provider setup check failure detection
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/lib/SetupChecks/OcxProviders.php2
-rw-r--r--apps/settings/tests/SetupChecks/OcxProvicersTest.php14
2 files changed, 8 insertions, 8 deletions
diff --git a/apps/settings/lib/SetupChecks/OcxProviders.php b/apps/settings/lib/SetupChecks/OcxProviders.php
index d24f2843829..f387fe23a32 100644
--- a/apps/settings/lib/SetupChecks/OcxProviders.php
+++ b/apps/settings/lib/SetupChecks/OcxProviders.php
@@ -68,7 +68,7 @@ class OcxProviders implements ISetupCheck {
];
foreach ($providers as $provider) {
- foreach ($this->runHEAD($this->urlGenerator->getWebroot() . $provider) as $response) {
+ foreach ($this->runRequest('HEAD', $this->urlGenerator->getWebroot() . $provider, ['httpErrors' => false]) as $response) {
$testedProviders[$provider] = true;
if ($response->getStatusCode() === 200) {
$workingProviders[] = $provider;
diff --git a/apps/settings/tests/SetupChecks/OcxProvicersTest.php b/apps/settings/tests/SetupChecks/OcxProvicersTest.php
index f0f504af027..2cc6ac6de07 100644
--- a/apps/settings/tests/SetupChecks/OcxProvicersTest.php
+++ b/apps/settings/tests/SetupChecks/OcxProvicersTest.php
@@ -62,7 +62,7 @@ class OcxProvicersTest extends TestCase {
$this->logger = $this->createMock(LoggerInterface::class);
$this->setupcheck = $this->getMockBuilder(OcxProviders::class)
- ->onlyMethods(['runHEAD'])
+ ->onlyMethods(['runRequest'])
->setConstructorArgs([
$this->l10n,
$this->config,
@@ -79,7 +79,7 @@ class OcxProvicersTest extends TestCase {
$this->setupcheck
->expects($this->exactly(2))
- ->method('runHEAD')
+ ->method('runRequest')
->willReturnOnConsecutiveCalls($this->generate([$response]), $this->generate([$response]));
$result = $this->setupcheck->run();
@@ -94,7 +94,7 @@ class OcxProvicersTest extends TestCase {
$this->setupcheck
->expects($this->exactly(2))
- ->method('runHEAD')
+ ->method('runRequest')
->willReturnOnConsecutiveCalls($this->generate([$response1, $response1, $response1]), $this->generate([$response2])); // only one response out of two
$result = $this->setupcheck->run();
@@ -107,7 +107,7 @@ class OcxProvicersTest extends TestCase {
$this->setupcheck
->expects($this->exactly(2))
- ->method('runHEAD')
+ ->method('runRequest')
->willReturnOnConsecutiveCalls($this->generate([]), $this->generate([])); // No responses
$result = $this->setupcheck->run();
@@ -121,7 +121,7 @@ class OcxProvicersTest extends TestCase {
$this->setupcheck
->expects($this->exactly(2))
- ->method('runHEAD')
+ ->method('runRequest')
->willReturnOnConsecutiveCalls($this->generate([$response]), $this->generate([])); // only one response out of two
$result = $this->setupcheck->run();
@@ -135,7 +135,7 @@ class OcxProvicersTest extends TestCase {
$this->setupcheck
->expects($this->exactly(2))
- ->method('runHEAD')
+ ->method('runRequest')
->willReturnOnConsecutiveCalls($this->generate([$response]), $this->generate([$response])); // only one response out of two
$result = $this->setupcheck->run();
@@ -151,7 +151,7 @@ class OcxProvicersTest extends TestCase {
$this->setupcheck
->expects($this->exactly(2))
- ->method('runHEAD')
+ ->method('runRequest')
->willReturnOnConsecutiveCalls($this->generate([$response1]), $this->generate([$response2]));
$result = $this->setupcheck->run();