generated from ohseesoftware/laravel-package-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add mocks for reading, upserting, and deleting Cronofy events
- Loading branch information
Showing
5 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
fixtures/cronofy/responses/v1/calendars/:id/events/post.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"event_id": "00000", | ||
"summary": "Board meeting", | ||
"description": "Discuss plans for the next quarter.", | ||
"start": "2022-01-15T15:30:00Z", | ||
"end": "2022-01-15T17:00:00Z", | ||
"location": { | ||
"description": "Board room" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"pages": { | ||
"current": 1, | ||
"total": 2, | ||
"next_page": "https://api.cronofy.com/v1/events/pages/08a07b034306679e" | ||
}, | ||
"events": [ | ||
{ | ||
"calendar_id": "cal_00000", | ||
"event_uid": "evt_external_00000", | ||
"summary": "Company Retreat", | ||
"description": "", | ||
"start": "2014-09-06", | ||
"end": "2014-09-08", | ||
"deleted": false, | ||
"created": "2022-01-14T08:00:01Z", | ||
"updated": "2022-01-14T09:24:16Z", | ||
"location": { | ||
"description": "Beach" | ||
}, | ||
"participation_status": "needs_action", | ||
"attendees": [ | ||
{ | ||
"email": "[email protected]", | ||
"display_name": "Example Person", | ||
"status": "needs_action" | ||
} | ||
], | ||
"organizer": { | ||
"email": "[email protected]", | ||
"display_name": "Example Person" | ||
}, | ||
"transparency": "opaque", | ||
"status": "confirmed", | ||
"categories": [], | ||
"recurring": false, | ||
"event_private": false, | ||
"options": { | ||
"delete": true, | ||
"update": true, | ||
"change_participation_status": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace OhSeeSoftware\LaravelVeneer\Providers\Cronofy\Events; | ||
|
||
use OhSeeSoftware\LaravelVeneer\Providers\MockedMethod; | ||
|
||
class DeleteEventMock extends MockedMethod | ||
{ | ||
public function fixturePath(): ?string | ||
{ | ||
return null; | ||
} | ||
|
||
public function method(): string | ||
{ | ||
return 'deleteEvent'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace OhSeeSoftware\LaravelVeneer\Providers\Cronofy\Events; | ||
|
||
use OhSeeSoftware\LaravelVeneer\Providers\MockedMethod; | ||
|
||
class ReadEventsMock extends MockedMethod | ||
{ | ||
public function fixturePath(): ?string | ||
{ | ||
return 'cronofy/responses/v1/events/index.json'; | ||
} | ||
|
||
public function method(): string | ||
{ | ||
return 'readEvents'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace OhSeeSoftware\LaravelVeneer\Providers\Cronofy\Events; | ||
|
||
use OhSeeSoftware\LaravelVeneer\Providers\MockedMethod; | ||
|
||
class UpsertEventMock extends MockedMethod | ||
{ | ||
public function fixturePath(): ?string | ||
{ | ||
return 'cronofy/responses/v1/calendars/:id/events/post.json'; | ||
} | ||
|
||
public function method(): string | ||
{ | ||
return 'upsertEvent'; | ||
} | ||
} |