mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
fix: Fix ocm-provider setup check failure detection
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
a47a1e6249
commit
1fffdf4763
2 changed files with 8 additions and 8 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue