diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2024-01-29 15:16:24 +0000 |
|---|---|---|
| committer | Moritz Strohm <strohm@data-quest.de> | 2024-01-29 15:16:24 +0000 |
| commit | 7c1df847d94d3956bc763b94b73cebfe108dc9a1 (patch) | |
| tree | e18e003bff65c5bf0748c644d6cd3d235cb1feca /tests/jsonapi/UserEventsIcalTest.php | |
| parent | da0110d5e85279123e8dde392cb4c926397238bf (diff) | |
StEP 01354, closes #1354
Closes #1354
Merge request studip/studip!2116
Diffstat (limited to 'tests/jsonapi/UserEventsIcalTest.php')
| -rw-r--r-- | tests/jsonapi/UserEventsIcalTest.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/jsonapi/UserEventsIcalTest.php b/tests/jsonapi/UserEventsIcalTest.php index 81230d4..c679f49 100644 --- a/tests/jsonapi/UserEventsIcalTest.php +++ b/tests/jsonapi/UserEventsIcalTest.php @@ -23,16 +23,18 @@ class UserEventsIcalTest extends \Codeception\Test\Unit { $credentials = $this->tester->getCredentialsForTestAutor(); - $calendar = new \SingleCalendar($credentials['id']); - $event = $calendar->getNewEvent(); - $event->setTitle('blypyp'); - - $oldUser = $GLOBALS['user'] ?? null; - $GLOBALS['user'] = \User::find($credentials['id']); - - $calendar->storeEvent($event, [$credentials['id']]); - - $GLOBALS['user'] = $oldUser; + $event = new \CalendarDate(); + $event->setId($event->getNewId()); + $now = time(); + $event->begin = $now; + $event->end = $now + 3600; + $event->title = 'blypyp'; + $event->store(); + $calendar_date = new \CalendarDateAssignment(); + $calendar_date->setId([$credentials['id'], $event->getId()]); + $calendar_date->calendar_date = $event; + $calendar_date->suppress_mails = true; + $calendar_date->store(); $app = $this->tester->createApp($credentials, 'get', '/users/{id}/events.ics', UserEventsIcal::class); |
