0
0
mirror of https://github.com/nextcloud/server.git synced 2025-01-01 18:00:09 +00:00
nextcloud_server/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php
Richard Steinmetz 6121325310
Merge pull request #45532 from nextcloud/feat/publish-resources-room-update
feat: implement public OCP api to update resources and rooms
2024-06-25 16:48:30 +02:00

54 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Tests\unit\BackgroundJob;
use OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Calendar\Resource\IManager as IResourceManager;
use OCP\Calendar\Room\IManager as IRoomManager;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
private UpdateCalendarResourcesRoomsBackgroundJob $backgroundJob;
/** @var ITimeFactory|MockObject */
private $time;
/** @var IResourceManager|MockObject */
private $resourceManager;
/** @var IRoomManager|MockObject */
private $roomManager;
protected function setUp(): void {
parent::setUp();
$this->time = $this->createMock(ITimeFactory::class);
$this->resourceManager = $this->createMock(IResourceManager::class);
$this->roomManager = $this->createMock(IRoomManager::class);
$this->backgroundJob = new UpdateCalendarResourcesRoomsBackgroundJob(
$this->time,
$this->resourceManager,
$this->roomManager,
);
}
public function testRun(): void {
$this->resourceManager->expects(self::once())
->method('update');
$this->roomManager->expects(self::once())
->method('update');
$this->backgroundJob->run([]);
}
}