Skip to content

Commit

Permalink
fixup! Fix/handle-duplicate-reminder
Browse files Browse the repository at this point in the history
Signed-off-by: Hamza Mahjoubi <[email protected]>
  • Loading branch information
hamza221 committed Apr 10, 2024
1 parent 38bcbb4 commit 297b144
Showing 1 changed file with 1 addition and 49 deletions.
50 changes: 1 addition & 49 deletions apps/dav/tests/unit/CalDAV/Reminder/BackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,35 +126,6 @@ public function testRemoveReminder(): void {
$this->assertCount(3, $rows);
}

public function testGetDuplicateRemindersToProcess(): void {
$this->timeFactory->expects($this->exactly(1))
->method('getTime')
->with()
->willReturn(123457);

$rows = $this->reminderBackend->getRemindersToProcess();

$this->assertCount(1, $rows);
unset($rows[0]['id']);

$this->assertEquals($rows[0], [
'calendar_id' => 1,
'object_id' => 1,
'uid' => 'asd',
'is_recurring' => false,
'recurrence_id' => 123458,
'is_recurrence_exception' => false,
'event_hash' => 'asd123',
'alarm_hash' => 'asd567',
'type' => 'EMAIL',
'is_relative' => true,
'notification_date' => 123456,
'is_repeat_based' => false,
'calendardata' => 'Calendar data 123',
'displayname' => 'Displayname 123',
'principaluri' => 'principals/users/user001',
]);
}
public function testGetRemindersToProcess(): void {
$this->timeFactory->expects($this->exactly(1))
->method('getTime')
Expand All @@ -163,9 +134,8 @@ public function testGetRemindersToProcess(): void {

$rows = $this->reminderBackend->getRemindersToProcess();

$this->assertCount(2, $rows);
$this->assertCount(1, $rows);
unset($rows[0]['id']);
unset($rows[1]['id']);

$this->assertEquals($rows[0], [
'calendar_id' => 1,
Expand All @@ -184,25 +154,7 @@ public function testGetRemindersToProcess(): void {
'displayname' => 'Displayname 123',
'principaluri' => 'principals/users/user001',
]);
$this->assertEquals($rows[1], [
'calendar_id' => 1,
'object_id' => 1,
'uid' => 'asd',
'is_recurring' => false,
'recurrence_id' => 123458,
'is_recurrence_exception' => false,
'event_hash' => 'asd456',
'alarm_hash' => 'asd567',
'type' => 'AUDIO',
'is_relative' => true,
'notification_date' => 123456,
'is_repeat_based' => false,
'calendardata' => 'Calendar data 123',
'displayname' => 'Displayname 123',
'principaluri' => 'principals/users/user001',
]);
}

public function testGetAllScheduledRemindersForEvent(): void {
$rows = $this->reminderBackend->getAllScheduledRemindersForEvent(1);

Expand Down

0 comments on commit 297b144

Please sign in to comment.