fix: Fix ocm-provider setup check failure detection

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2024-03-07 18:38:39 +01:00 committed by Ferdinand Thiessen
parent a47a1e6249
commit 1fffdf4763
2 changed files with 8 additions and 8 deletions

View file

@ -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;

View file

@ -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();