aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Collaboration/Resources/ProviderManagerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Collaboration/Resources/ProviderManagerTest.php')
-rw-r--r--tests/lib/Collaboration/Resources/ProviderManagerTest.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/lib/Collaboration/Resources/ProviderManagerTest.php b/tests/lib/Collaboration/Resources/ProviderManagerTest.php
index 01c201e0a4e..b063d89f06e 100644
--- a/tests/lib/Collaboration/Resources/ProviderManagerTest.php
+++ b/tests/lib/Collaboration/Resources/ProviderManagerTest.php
@@ -77,13 +77,14 @@ class ProviderManagerTest extends TestCase {
public function testGetResourceProvidersValidAndInvalidProvider(): void {
$this->serverContainer->expects($this->exactly(2))
->method('query')
- ->withConsecutive(
- [$this->equalTo('InvalidResourceProvider')],
- [$this->equalTo(ResourceProvider::class)],
- )->willReturnOnConsecutiveCalls(
- $this->throwException(new QueryException('A meaningful error message')),
- $this->createMock(ResourceProvider::class),
- );
+ ->willReturnCallback(function (string $service) {
+ if ($service === 'InvalidResourceProvider') {
+ throw new QueryException('A meaningful error message');
+ }
+ if ($service === ResourceProvider::class) {
+ return $this->createMock(ResourceProvider::class);
+ }
+ });
$this->logger->expects($this->once())
->method('error');