aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php')
-rw-r--r--apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php49
1 files changed, 27 insertions, 22 deletions
diff --git a/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php b/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php
index e1d22bc3e7b..ba0da422290 100644
--- a/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php
+++ b/apps/dav/tests/unit/CalDAV/CachedSubscriptionTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -140,19 +141,21 @@ class CachedSubscriptionTest extends \Test\TestCase {
'uri' => 'cal',
];
+ $calls = [
+ [666, 'foo1', 1, [
+ 'id' => 99,
+ 'uri' => 'foo1'
+ ]],
+ [666, 'foo2', 1, null],
+ ];
$backend->expects($this->exactly(2))
->method('getCalendarObject')
- ->withConsecutive(
- [666, 'foo1', 1],
- [666, 'foo2', 1],
- )
- ->willReturnOnConsecutiveCalls(
- [
- 'id' => 99,
- 'uri' => 'foo1'
- ],
- null
- );
+ ->willReturnCallback(function () use (&$calls) {
+ $expected = array_shift($calls);
+ $return = array_pop($expected);
+ $this->assertEquals($expected, func_get_args());
+ return $return;
+ });
$calendar = new CachedSubscription($backend, $calendarInfo);
@@ -250,19 +253,21 @@ class CachedSubscriptionTest extends \Test\TestCase {
'uri' => 'cal',
];
+ $calls = [
+ [666, 'foo1', 1, [
+ 'id' => 99,
+ 'uri' => 'foo1'
+ ]],
+ [666, 'foo2', 1, null],
+ ];
$backend->expects($this->exactly(2))
->method('getCalendarObject')
- ->withConsecutive(
- [666, 'foo1', 1],
- [666, 'foo2', 1],
- )
- ->willReturnOnConsecutiveCalls(
- [
- 'id' => 99,
- 'uri' => 'foo1'
- ],
- null
- );
+ ->willReturnCallback(function () use (&$calls) {
+ $expected = array_shift($calls);
+ $return = array_pop($expected);
+ $this->assertEquals($expected, func_get_args());
+ return $return;
+ });
$calendar = new CachedSubscription($backend, $calendarInfo);