|
1 | 1 | <?php |
| 2 | + |
2 | 3 | /** |
3 | 4 | * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors |
4 | 5 | * SPDX-License-Identifier: AGPL-3.0-or-later |
@@ -738,4 +739,42 @@ function (string $eventName, array $arguments = [], ?callable $continueCallBack |
738 | 739 |
|
739 | 740 | } |
740 | 741 |
|
| 742 | + /** |
| 743 | + * Test Calendar Event Creation with iTip and iMip disabled |
| 744 | + * |
| 745 | + * Should generate 2 messages for attendees User 2 and User External |
| 746 | + */ |
| 747 | + public function testCalendarObjectChangeWithSchedulingDisabled(): void { |
| 748 | + // construct server request |
| 749 | + $request = new Request( |
| 750 | + 'PUT', |
| 751 | + '/remote.php/dav/calendars/user1/personal/B0DC78AE-6DD7-47E3-80BE-89F23E6D5383.ics', |
| 752 | + ['x-nc-scheduling' => 'false'] |
| 753 | + ); |
| 754 | + $request->setBaseUrl('/remote.php/dav/'); |
| 755 | + // construct server response |
| 756 | + $response = new Response(); |
| 757 | + // construct server tree |
| 758 | + $tree = $this->createMock(Tree::class); |
| 759 | + $tree->expects($this->never()) |
| 760 | + ->method('getNodeForPath'); |
| 761 | + // construct server properties and returns |
| 762 | + $this->server->httpRequest = $request; |
| 763 | + $this->server->tree = $tree; |
| 764 | + // construct empty calendar event |
| 765 | + $vCalendar = new VCalendar(); |
| 766 | + $vEvent = $vCalendar->add('VEVENT', []); |
| 767 | + // define flags |
| 768 | + $newFlag = true; |
| 769 | + $modifiedFlag = false; |
| 770 | + // execute method |
| 771 | + $this->plugin->calendarObjectChange( |
| 772 | + $request, |
| 773 | + $response, |
| 774 | + $vCalendar, |
| 775 | + 'calendars/user1/personal', |
| 776 | + $modifiedFlag, |
| 777 | + $newFlag |
| 778 | + ); |
| 779 | + } |
741 | 780 | } |
0 commit comments