mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Remove last at matcher call in dav application tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
30a7eabad3
commit
4b8ef84440
1 changed files with 6 additions and 13 deletions
|
|
@ -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))
|
||||
$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(123, $parameter->getKey());
|
||||
});
|
||||
|
||||
$calendarManager->expects($this->at(1))
|
||||
->method('registerCalendar')
|
||||
->willReturnCallback(function (): void {
|
||||
$parameter = func_get_arg(0);
|
||||
$this->assertInstanceOf(CalendarImpl::class, $parameter);
|
||||
$this->assertEquals(456, $parameter->getKey());
|
||||
$registeredIds[] = $parameter->getKey();
|
||||
});
|
||||
|
||||
$this->manager->setupCalendarProvider($calendarManager, 'user123');
|
||||
|
||||
$this->assertEquals(['123','456'], $registeredIds);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue