Skip to content
Closed
Prev Previous commit
Next Next commit
fixup! feat: create example event when a user logs in for the first time
  • Loading branch information
st3iny committed Jan 28, 2025
commit d8575daba542e77da7df41669ed54b3a12e44cb2
11 changes: 8 additions & 3 deletions tests/php/unit/Service/ExampleEventServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ class ExampleEventServiceTest extends TestCase {
private IAppConfig&MockObject $appConfig;

protected function setUp(): void {
if (!interface_exists(ICalendarEventBuilder::class)) {
$this->markTestSkipped('Feature is not available on this version of Nextcloud');
return;
}

$this->calendarManager = $this->createMock(ICalendarManager::class);
$this->random = $this->createMock(ISecureRandom::class);
$this->time = $this->createMock(ITimeFactory::class);
Expand All @@ -57,7 +62,7 @@ public static function createExampleEventWithCustomEventDataProvider(): array {
}

/** @dataProvider createExampleEventWithCustomEventDataProvider */
public function testCreateExampleEventWithCustomEvent($customEventIcs) {
public function testCreateExampleEventWithCustomEvent($customEventIcs): void {
$calendar = $this->createMock(ICreateFromString::class);
$this->calendarManager->expects(self::once())
->method('getCalendarsForPrincipal')
Expand Down Expand Up @@ -99,7 +104,7 @@ public function testCreateExampleEventWithCustomEvent($customEventIcs) {
$this->service->createExampleEvent('user');
}

public function testCreateExampleEventWithDefaultEvent() {
public function testCreateExampleEventWithDefaultEvent(): void {
$calendar = $this->createMock(ICreateFromString::class);
$this->calendarManager->expects(self::once())
->method('getCalendarsForPrincipal')
Expand Down Expand Up @@ -141,7 +146,7 @@ public function testCreateExampleEventWithDefaultEvent() {
$this->service->createExampleEvent('user');
}

public function testCreateExampleEventWithoutCalendars() {
public function testCreateExampleEventWithoutCalendars(): void {
$this->calendarManager->expects(self::once())
->method('getCalendarsForPrincipal')
->with('principals/users/invalid')
Expand Down
Loading