aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-09-14 15:01:26 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-09-14 15:01:26 +0200
commit4b8ef84440fa832d0c6b0a5dccc5928d0585576e (patch)
treea074c06761472dd7b9a07474f63d85a17eab3496 /apps/dav/tests
parent30a7eabad3f00fe10fa2d66725297a559aa82c3c (diff)
downloadnextcloud-server-4b8ef84440fa832d0c6b0a5dccc5928d0585576e.tar.gz
nextcloud-server-4b8ef84440fa832d0c6b0a5dccc5928d0585576e.zip
Remove last at matcher call in dav application tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/CalDAV/CalendarManagerTest.php19
1 files changed, 6 insertions, 13 deletions
diff --git a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php
index 8a559255a8c..c803afe6acf 100644
--- a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php
@@ -36,7 +36,6 @@ use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
class CalendarManagerTest extends \Test\TestCase {
-
/** @var CalDavBackend | MockObject */
private $backend;
@@ -77,22 +76,16 @@ class CalendarManagerTest extends \Test\TestCase {
/** @var IManager | MockObject $calendarManager */
$calendarManager = $this->createMock(Manager::class);
- $calendarManager->expects($this->at(0))
- ->method('registerCalendar')
- ->willReturnCallback(function (): void {
- $parameter = func_get_arg(0);
- $this->assertInstanceOf(CalendarImpl::class, $parameter);
- $this->assertEquals(123, $parameter->getKey());
- });
-
- $calendarManager->expects($this->at(1))
+ $registeredIds = [];
+ $calendarManager->expects($this->exactly(2))
->method('registerCalendar')
- ->willReturnCallback(function (): void {
- $parameter = func_get_arg(0);
+ ->willReturnCallback(function ($parameter) use (&$registeredIds): void {
$this->assertInstanceOf(CalendarImpl::class, $parameter);
- $this->assertEquals(456, $parameter->getKey());
+ $registeredIds[] = $parameter->getKey();
});
$this->manager->setupCalendarProvider($calendarManager, 'user123');
+
+ $this->assertEquals(['123','456'], $registeredIds);
}
}