Skip to content

Commit b6df381

Browse files
Merge pull request #14 from anteprimorac/master
Update event and participation status values per rfc5545
2 parents 1da646c + 7608d9c commit b6df381

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

src/Enums/EventStatus.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
use Spatie\Enum\Enum;
66

77
/**
8-
* @method static self accepted()
9-
* @method static self declined()
108
* @method static self tentative()
9+
* @method static self confirmed()
10+
* @method static self cancelled()
1111
*/
1212
class EventStatus extends Enum
1313
{
1414
const MAP_VALUE = [
15-
'accepted' => 'ACCEPTED',
16-
'declined' => 'DECLINED',
1715
'tentative' => 'TENTATIVE',
16+
'confirmed' => 'CONFIRMED',
17+
'cancelled' => 'CANCELLED',
1818
];
1919
}

src/Enums/ParticipationStatus.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@
55
use Spatie\Enum\Enum;
66

77
/**
8+
* @method static self needs_action()
89
* @method static self accepted()
910
* @method static self declined()
1011
* @method static self tentative()
12+
* @method static self delegated()
1113
*/
1214
class ParticipationStatus extends Enum
1315
{
1416
const MAP_VALUE = [
17+
'needs_action' => 'NEEDS-ACTION',
1518
'accepted' => 'ACCEPTED',
1619
'declined' => 'DECLINED',
1720
'tentative' => 'TENTATIVE',
21+
'delegated' => 'DELEGATED',
1822
];
1923
}

tests/Components/EventTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,12 @@ public function it_can_add_attendees()
227227
public function it_can_set_a_status()
228228
{
229229
$payload = Event::create()
230-
->status(EventStatus::accepted())
230+
->status(EventStatus::tentative())
231231
->resolvePayload();
232232

233233
$this->assertPropertyEqualsInPayload(
234234
'STATUS',
235-
EventStatus::accepted()->getValue(),
235+
EventStatus::tentative()->getValue(),
236236
$payload
237237
);
238238
}

tests/IntegrationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function it_can_create_a_calendar()
3636
->attendee('freek@spatie.be', 'Freek', ParticipationStatus::tentative())
3737
->transparent()
3838
->classification(Classification::public())
39-
->status(EventStatus::accepted())
39+
->status(EventStatus::tentative())
4040
->alert(
4141
Alert::date(
4242
new DateTime('05/16/2020 12:00:00'),
@@ -74,7 +74,7 @@ public function it_can_create_a_calendar()
7474
LOCATION:Samberstraat 69D\, 2060 Antwerp\, Belgium\r
7575
CLASS:PUBLIC\r
7676
TRANSP:TRANSPARENT\r
77-
STATUS:ACCEPTED\r
77+
STATUS:TENTATIVE\r
7878
DTSTART:20190306T150000\r
7979
DTEND:20190306T160000\r
8080
DTSTAMP:20190306T160000\r

0 commit comments

Comments
 (0)