From 04cf46addd1653db528a2091df675c85dccd14dc Mon Sep 17 00:00:00 2001 From: Petre Date: Fri, 20 Sep 2024 09:49:50 +0200 Subject: [PATCH] feat: added more tests --- src/Api/Meetings/Meeting.php | 114 +- tests/Fake/Meetings/MeetingsFakeResponse.php | 498 +++++++- tests/Unit/Meetings/MeetingsTest.php | 1180 ++++++++++++++++++ 3 files changed, 1736 insertions(+), 56 deletions(-) diff --git a/src/Api/Meetings/Meeting.php b/src/Api/Meetings/Meeting.php index f6a1e46..6807d2d 100644 --- a/src/Api/Meetings/Meeting.php +++ b/src/Api/Meetings/Meeting.php @@ -73,11 +73,11 @@ public function listSeries( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'max' , 'from' , 'to' , 'meetingType' , 'state' , 'isModified' , 'hasChat' , 'hasRecording' , 'hasTranscription' , 'hasCloseCaption' , 'hasPolls' , 'hasQA' , 'hostEmail' + 'max', 'from', 'to', 'meetingType', 'state', 'isModified', 'hasChat', 'hasRecording', 'hasTranscription', 'hasCloseCaption', 'hasPolls', 'hasQA', 'hostEmail', ]); $response = $this->get('meetings', array_merge([ - 'meetingSeriesId' => $meetingSeriesId + 'meetingSeriesId' => $meetingSeriesId, ], $additional_data)); if (! $response->success) { @@ -92,7 +92,7 @@ public function listSeries( } //TODO check function patch - public function patch( + /*public function patch( string $meetingId, ?array $additional_data = [] ) { @@ -107,7 +107,7 @@ public function patch( } return new MeetingsEntity($response->data); - } + }*/ public function update( string $meeting_id, @@ -156,7 +156,7 @@ public function join( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'meetingId', 'meetingNumber', 'webLink', 'joinDirectly', 'email', 'displayName', 'password', 'expirationMinutes', 'registrationId', 'hostEmail', 'createJoinLinkAsWebLink', 'createStartLinkAsWebLink' + 'meetingId', 'meetingNumber', 'webLink', 'joinDirectly', 'email', 'displayName', 'password', 'expirationMinutes', 'registrationId', 'hostEmail', 'createJoinLinkAsWebLink', 'createStartLinkAsWebLink', ]); $response = $this->post('meetings/join', $additional_data); @@ -173,7 +173,7 @@ public function listTemplates( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'templateType', 'locale', 'isDefault', 'isStandard', 'hostEmail', 'siteUrl' + 'templateType', 'locale', 'isDefault', 'isStandard', 'hostEmail', 'siteUrl', ]); $response = $this->get('meetings/templates', $additional_data); @@ -197,7 +197,7 @@ public function detailTemplate( 'hostEmail', ]); - $response = $this->get('meetings/templates'.$templateId, $additional_data); + $response = $this->get('meetings/templates/'.$templateId, $additional_data); if (! $response->success) { return new Error($response->data); @@ -210,7 +210,9 @@ public function detailControlStatus( string $meetingId ) { - $response = $this->get('meetings/controls', $meetingId); + $response = $this->get('meetings/controls', [ + 'meetingId' => $meetingId, + ]); if (! $response->success) { return new Error($response->data); @@ -225,7 +227,7 @@ public function updateControlStatus( ) { $additional_data = $this->data($additional_data, [ 'recordingStarted', 'recordingPaused', 'locked', - ]); + ]); $response = $this->put('meetings/controls', array_merge([ 'meetingId' => $meetingId, @@ -238,11 +240,11 @@ public function updateControlStatus( return new MeetingsEntity($response->data); } - public function detailSessionTypes( + public function listSessionTypes( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'hostEmail', 'siteUrl' + 'hostEmail', 'siteUrl', ]); $response = $this->get('meetings/sessionTypes', $additional_data); @@ -251,15 +253,19 @@ public function detailSessionTypes( return new Error($response->data); } - return new MeetingsEntity($response->data); + $meetings = $response->data; + + return array_map(function ($meeting) { + return new MeetingsEntity($meeting); + }, $meetings->items); } public function detailSessionType( - int $sessionTypeId, + string $sessionTypeId, ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'hostEmail', 'siteUrl' + 'hostEmail', 'siteUrl', ]); $response = $this->get('meetings/sessionTypes/'.$sessionTypeId, $additional_data); @@ -272,11 +278,11 @@ public function detailSessionType( } public function detailRegistrationForm( - int $meetingId, + string $meetingId, ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'current', 'hostEmail' + 'current', 'hostEmail', ]); $response = $this->get('meetings/'.$meetingId.'/registration', $additional_data); @@ -288,12 +294,12 @@ public function detailRegistrationForm( return new MeetingsEntity($response->data); } - public function updateRegistrationFrom( + public function updateRegistrationForm( string $meetingId, ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'hostEmail', 'autoAcceptRequest','requireFirstName','requireEmail','requireJobTitle','requireCompanyName','requireAddress1','requireAddress2','requireCity','requireState','requireZipCode','requireCountryRegion','requireWorkPhone','requireFax','maxRegisterNum','customizedQuestions','rules' + 'hostEmail', 'autoAcceptRequest', 'requireFirstName', 'requireEmail', 'requireJobTitle', 'requireCompanyName', 'requireAddress1', 'requireAddress2', 'requireCity', 'requireState', 'requireZipCode', 'requireCountryRegion', 'requireWorkPhone', 'requireFax', 'maxRegisterNum', 'customizedQuestions', 'rules', ]); $response = $this->put('meetings/'.$meetingId.'/registration', $additional_data); @@ -308,7 +314,7 @@ public function updateRegistrationFrom( public function destroyRegistrationForm( string $meetingId ) { - $response = $this->delete('meetings/' .$meetingId. '/registration', []); + $response = $this->delete('meetings/'.$meetingId.'/registration', []); if (! $response->success) { return new Error($response->data); @@ -325,14 +331,14 @@ public function register( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'current', 'hostEmail', 'sendEmail', 'jobTitle', 'companyName', 'address1', 'address2', 'city', 'state', 'zipCode', 'countryRegion', 'workPhone', 'fax', 'customizedQuestions' + 'current', 'hostEmail', 'sendEmail', 'jobTitle', 'companyName', 'address1', 'address2', 'city', 'state', 'zipCode', 'countryRegion', 'workPhone', 'fax', 'customizedQuestions', ]); $response = $this->post('meetings/'.$meetingId.'/registrants', array_merge([ 'firstName' => $firstName, 'lastName' => $lastName, - 'email' => $email - ], $additional_data)); + 'email' => $email, + ], $additional_data)); if (! $response->success) { return new Error($response->data); @@ -346,7 +352,7 @@ public function batchRegister( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'current', 'hostEmail', 'items' + 'current', 'hostEmail', 'items', ]); $response = $this->post('meetings/'.$meetingId.'/registrants/bulkInsert', $additional_data); @@ -364,7 +370,7 @@ public function detailInformationForRegistrant( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'current', 'hostEmail' + 'current', 'hostEmail', ]); $response = $this->get('meetings/'.$meetingId.'/registrants/'.$registrantId, $additional_data); @@ -381,10 +387,10 @@ public function listRegistrants( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'max', 'hostEmail', 'current', 'email', 'registrationTimeFrom', 'registrationTimeTo' + 'max', 'hostEmail', 'current', 'email', 'registrationTimeFrom', 'registrationTimeTo', ]); - $response = $this->get('meetings/'. $meetingId .'/registrants', $additional_data); + $response = $this->get('meetings/'.$meetingId.'/registrants', $additional_data); if (! $response->success) { return new Error($response->data); @@ -403,7 +409,7 @@ public function queryRegistrants( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'max', 'current', 'hostEmail', 'status', 'orderType', 'orderBy' + 'max', 'current', 'hostEmail', 'status', 'orderType', 'orderBy', ]); $response = $this->post('meetings/'.$meetingId.'/registrants/query', array_merge([ @@ -423,10 +429,10 @@ public function batchUpdateRegistrantsStatus( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'current', 'hostEmail', 'sendEmail', 'registrants' + 'current', 'hostEmail', 'sendEmail', 'registrants', ]); - $response = $this->post('meetings/'.$meetingId.'/registrants/' .$statusOpType, $additional_data); + $response = $this->post('meetings/'.$meetingId.'/registrants/'.$statusOpType, $additional_data); if (! $response->success) { return new Error($response->data); @@ -441,10 +447,10 @@ public function destroyRegistrant( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'current', 'hostEmail' + 'current', 'hostEmail', ]); - $response = $this->delete('meetings/' .$meetingId. '/registrants/'. $registrantId, $additional_data); + $response = $this->delete('meetings/'.$meetingId.'/registrants/'.$registrantId, $additional_data); if (! $response->success) { return new Error($response->data); @@ -459,7 +465,7 @@ public function updateSimultaneousInterpretation( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'interpreters' + 'interpreters', ]); $response = $this->put('meetings/'.$meetingId.'/simultaneousInterpretation', array_merge([ @@ -480,12 +486,12 @@ public function createInterpreter( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'email', 'displayName', 'hostEmail', 'sendEmail' + 'email', 'displayName', 'hostEmail', 'sendEmail', ]); $response = $this->post('meetings/'.$meetingId.'/interpreters', array_merge([ 'languageCode1' => $languageCode1, - 'languageCode2' => $languageCode2 + 'languageCode2' => $languageCode2, ], $additional_data)); if (! $response->success) { @@ -501,7 +507,7 @@ public function detailInterpreter( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'hostEmail' + 'hostEmail', ]); $response = $this->get('meetings/'.$meetingId.'/interpreters/'.$interpreterId, $additional_data); @@ -518,10 +524,10 @@ public function listInterpreters( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'hostEmail' + 'hostEmail', ]); - $response = $this->get('meetings/'. $meetingId .'interpreters', $additional_data); + $response = $this->get('meetings/'.$meetingId.'/interpreters', $additional_data); if (! $response->success) { return new Error($response->data); @@ -542,12 +548,12 @@ public function updateInterpreter( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'email', 'displayName', 'hostEmail', 'sendEmail' + 'email', 'displayName', 'hostEmail', 'sendEmail', ]); $response = $this->put('meetings/'.$meetingId.'/interpreters/'.$interpreterId, array_merge([ 'languageCode1' => $languageCode1, - 'languageCode2' => $languageCode2 + 'languageCode2' => $languageCode2, ], $additional_data)); if (! $response->success) { @@ -563,10 +569,10 @@ public function destroyInterpreter( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'hostEmail', 'sendEmail' + 'hostEmail', 'sendEmail', ]); - $response = $this->delete('meetings/' .$meetingId. '/interpreters/'.$interpreterId, $additional_data); + $response = $this->delete('meetings/'.$meetingId.'/interpreters/'.$interpreterId, $additional_data); if (! $response->success) { return new Error($response->data); @@ -579,7 +585,7 @@ public function listBreakoutSessions( string $meetingId ) { - $response = $this->get('meetings/'. $meetingId .'breakoutSessions', []); + $response = $this->get('meetings/'.$meetingId.'/breakoutSessions', []); if (! $response->success) { return new Error($response->data); @@ -597,7 +603,7 @@ public function updateBreakoutSessions( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'hostEmail', 'sendEmail', 'items' + 'hostEmail', 'sendEmail', 'items', ]); $response = $this->put('meetings/'.$meetingId.'/breakoutSessions', $additional_data); @@ -614,10 +620,10 @@ public function destroyBreakoutSessions( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'sendEmail' + 'sendEmail', ]); - $response = $this->delete('meetings/' .$meetingId. '/breakoutSessions', $additional_data); + $response = $this->delete('meetings/'.$meetingId.'/breakoutSessions', $additional_data); if (! $response->success) { return new Error($response->data); @@ -644,10 +650,10 @@ public function listSurveyResults( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'meetingStartTimeFrom', 'meetingStartTimeTo', 'max' + 'meetingStartTimeFrom', 'meetingStartTimeTo', 'max', ]); - $response = $this->get('meetings/'. $meetingId .'/surveyResults', $additional_data); + $response = $this->get('meetings/'.$meetingId.'/surveyResults', $additional_data); if (! $response->success) { return new Error($response->data); @@ -665,7 +671,7 @@ public function detailSurveyLinks( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'hostEmail', 'meetingStartTimeFrom', 'meetingStartTimeTo', 'emails' + 'hostEmail', 'meetingStartTimeFrom', 'meetingStartTimeTo', 'emails', ]); $response = $this->get('meetings/'.$meetingId.'/surveyLinks', $additional_data); @@ -682,7 +688,7 @@ public function createInvitationSources( ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'hostEmail', 'personId', 'items' + 'hostEmail', 'personId', 'items', ]); $response = $this->post('meetings/'.$meetingId.'/invitationSources', $additional_data); @@ -698,7 +704,7 @@ public function listInvitationSources( string $meetingId ) { - $response = $this->get('meetings/'. $meetingId .'/invitationSources', []); + $response = $this->get('meetings/'.$meetingId.'/invitationSources', []); if (! $response->success) { return new Error($response->data); @@ -711,16 +717,16 @@ public function listInvitationSources( }, $meetings->items); } - public function listMeetingTrackingCodes( + public function listTrackingCodes( string $service, ?array $additional_data = [] ) { $additional_data = $this->data($additional_data, [ - 'siteUrl', 'hostEmail' + 'siteUrl', 'hostEmail', ]); $response = $this->put('meetings/trackingCodes', array_merge([ - 'service' => $service + 'service' => $service, ], $additional_data)); if (! $response->success) { @@ -740,7 +746,7 @@ public function reassignToNewHost( ) { $response = $this->post('meetings/reassignHost', [ 'hostEmail' => $hostEmail, - 'meetingIds' => $meetingIds + 'meetingIds' => $meetingIds, ]); if (! $response->success) { diff --git a/tests/Fake/Meetings/MeetingsFakeResponse.php b/tests/Fake/Meetings/MeetingsFakeResponse.php index 5431357..3d871aa 100644 --- a/tests/Fake/Meetings/MeetingsFakeResponse.php +++ b/tests/Fake/Meetings/MeetingsFakeResponse.php @@ -23,6 +23,23 @@ public function getFilteredMeetingsFakeList() ]); } + public function getMeetingsFakeListSeries() + { + return json_encode((object) [ + 'items' => [ + $this->fakeMeeting(), + $this->fakeMeeting(), + ], + ]); + } + + public function getErrorOnMeetingsFakeListSeries() + { + return json_encode( + $this->fakeError() + ); + } + public function getMeetingFakeDetail() { return json_encode( @@ -58,7 +75,484 @@ public function getDeleteMeetingFakeResponse() public function getErrorOnMeetingsFakeList() { return json_encode( - $this->fakeError() - ); + $this->fakeError() + ); + } + + public function getMeetingsFakeJoinDetail() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeJoin() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeListTemplates() + { + return json_encode((object) [ + 'items' => [ + $this->fakeMeeting(), + $this->fakeMeeting(), + ], + ]); + } + + public function getErrorOnMeetingsFakeListTemplates() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeDetailTemplate() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeDetailTemplate() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeDetailControlStatus() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeControlStatus() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeUpdateControlStatus() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeUpdateControlStatus() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeListSessionTypes() + { + return json_encode((object) [ + 'items' => [ + $this->fakeMeeting(), + $this->fakeMeeting(), + ], + ]); + } + + public function getErrorOnMeetingsFakeListSessionTypes() + { + return json_encode( + $this->fakeError() + ); + } + public function getMeetingsFakeDetailSessionType() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeDetailSessionTypes() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeDetailRegistrationForm() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeDetailRegistrationForm() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeUpdateRegistrationForm() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeUpdateRegistrationForm() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeDestroyRegistrationForm() + { + return null; + } + + public function getErrorOnMeetingsFakeDestroyRegistrationForm() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeRegister() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeRegister() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeBatchRegister() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeBatchRegister() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeDetailInformationForRegistrant() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeDetailInformationForRegistrant() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeListRegistrants() + { + return json_encode((object) [ + 'items' => [ + $this->fakeMeeting(), + $this->fakeMeeting(), + ], + ]); + } + + public function getErrorOnMeetingsFakeListRegistrants() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeQueryRegistrants() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeQueryRegistrants() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeUpdateRegistrantsStatus() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeUpdateRegistrantsStatus() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeDestroyRegistrant() + { + return null; + } + + public function getErrorOnMeetingsFakeDestroyRegistrant() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeUpdateSimultaneousInterpretation() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeUpdateSimultaneousInterpretation() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeCreateInterpreter() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeCreateInterpreter() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeDetailInterpreter() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeDetailInterpreter() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeListInterpreters() + { + return json_encode((object) [ + 'items' => [ + $this->fakeMeeting(), + $this->fakeMeeting(), + ], + ]); + } + + public function getErrorOnMeetingsFakeListInterpreters() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeUpdateInterpreters() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeUpdateInterpreters() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeDestroyInterpreter() + { + return null; + } + + public function getErrorOnMeetingsFakeDestroyInterpreter() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeListBreakoutSessions() + { + return json_encode((object) [ + 'items' => [ + $this->fakeMeeting(), + $this->fakeMeeting(), + ], + ]); + } + + public function getErrorOnMeetingsFakeListBreakoutSession() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeUpdateBreakoutSession() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeUpdateBreakoutSession() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeDestroyBreakoutSession() + { + return null; + } + + public function getErrorOnMeetingsFakeDestroyBreakoutSessions() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeDetailSurvey() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeDetailSurvey() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeListSurveyResults() + { + return json_encode((object) [ + 'items' => [ + $this->fakeMeeting(), + $this->fakeMeeting(), + ], + ]); + } + + public function getErrorOnMeetingsFakeListSurveyResults() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeDetailSurveyLinks() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeDetailSurveyLinks() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeCreateInvitationSources() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeCreateInvitationSources() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeListInvitationSources() + { + return json_encode((object) [ + 'items' => [ + $this->fakeMeeting(), + $this->fakeMeeting(), + ], + ]); + } + + public function getErrorOnMeetingsFakeListInvitationSources() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeListTrackingCodes() + { + return json_encode((object) [ + 'items' => [ + $this->fakeMeeting(), + $this->fakeMeeting(), + ], + ]); + } + + public function getErrorOnMeetingsFakeListTrackingCodes() + { + return json_encode( + $this->fakeError() + ); + } + + public function getMeetingsFakeReassignToNewHost() + { + return json_encode( + $this->fakeMeeting() + ); + } + + public function getErrorOnMeetingsFakeReassignToNewHost() + { + return json_encode( + $this->fakeError() + ); } } diff --git a/tests/Unit/Meetings/MeetingsTest.php b/tests/Unit/Meetings/MeetingsTest.php index 12e5914..8b8e06e 100644 --- a/tests/Unit/Meetings/MeetingsTest.php +++ b/tests/Unit/Meetings/MeetingsTest.php @@ -77,6 +77,46 @@ public function test_error_on_meeting_list() $this->assertEquals('fake_trackingId', $error_meeting->trackingId); } + public function test_meetings_list_series() + { + Http::fake([ + 'meetings?meetingSeriesId=fake_meeting_series_id' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeListSeries() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $meetings_list = $laravel_webex->meeting()->listSeries('fake_meeting_series_id'); + + $this->assertCount(2, $meetings_list); + + $single_meeting = null; + foreach ($meetings_list as $meeting) { + $this->assertInstanceOf(Meeting::class, $meeting); + $single_meeting = $meeting; + } + + $this->assertEquals('fake_id', $single_meeting->id); + } + + public function test_error_on_meetings_list_series() + { + Http::fake([ + 'meetings?meetingSeriesId=fake_meeting_series_id' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeListSeries(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->listSeries('fake_meeting_series_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + /* detail */ public function test_meeting_detail() @@ -204,4 +244,1144 @@ public function test_error_on_meeting_delete() $this->assertIsArray($delete_response->errors); $this->assertEquals('fake_trackingId', $delete_response->trackingId); } + + public function test_meeting_join() + { + Http::fake([ + 'meetings/join' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeJoinDetail() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $meeting_detail = $laravel_webex->meeting()->join(); + + $this->assertInstanceOf(Meeting::class, $meeting_detail); + } + + public function test_error_on_meeting_join() + { + Http::fake([ + 'meetings/join' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeJoin(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->join(); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_list_templates() + { + Http::fake([ + 'meetings/templates' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeListTemplates() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $meetings_list = $laravel_webex->meeting()->listTemplates(); + + $this->assertCount(2, $meetings_list); + + $single_meeting = null; + foreach ($meetings_list as $meeting) { + $this->assertInstanceOf(Meeting::class, $meeting); + $single_meeting = $meeting; + } + + $this->assertEquals('fake_id', $single_meeting->id); + } + + public function test_error_on_meeting_list_templates() + { + Http::fake([ + 'meetings/templates' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeListTemplates(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->listTemplates(); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_detail_template() + { + Http::fake([ + 'meetings/templates/fake_template_id' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeDetailTemplate() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $meetings_template_detail = $laravel_webex->meeting()->detailTemplate('fake_template_id'); + + $this->assertInstanceOf(Meeting::class, $meetings_template_detail); + $this->assertEquals('fake_id', $meetings_template_detail->id); + } + + public function test_error_on_meeting_detail_template() + { + Http::fake([ + 'meetings/templates/fake_template_id' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeDetailTemplate(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->detailTemplate('fake_template_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_detail_control_status() + { + Http::fake([ + 'meetings/controls?meetingId=fake_meeting_id' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeDetailControlStatus() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $control_status_detail = $laravel_webex->meeting()->detailControlStatus('fake_meeting_id'); + + $this->assertInstanceOf(Meeting::class, $control_status_detail); + $this->assertEquals('fake_id', $control_status_detail->id); + } + + public function test_error_on_meeting_control_status() + { + Http::fake([ + 'meetings/controls?meetingId=fake_meeting_id' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeControlStatus(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->detailControlStatus('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_update_control_status() + { + Http::fake([ + 'meetings/controls' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeUpdateControlStatus() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $updated_control_status = $laravel_webex->meeting()->updateControlStatus('fake_meeting_id'); + + $this->assertInstanceOf(Meeting::class, $updated_control_status); + $this->assertEquals('fake_id', $updated_control_status->id); + } + + public function test_error_on_meeting_update_control_status() + { + Http::fake([ + 'meetings/controls' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeUpdateControlStatus(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->updateControlStatus('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_list_session_types() + { + Http::fake([ + 'meetings/sessionTypes' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeListSessionTypes() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $session_types = $laravel_webex->meeting()->listSessionTypes(); + + $this->assertCount(2, $session_types); + + $single_session_type = null; + foreach ($session_types as $session_type) { + $this->assertInstanceOf(Meeting::class, $session_type); + $single_session_type = $session_type; + } + + $this->assertEquals('fake_id', $single_session_type->id); + } + + public function test_error_on_meeting_list_session_types() + { + Http::fake([ + 'meetings/sessionTypes' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeListSessionTypes(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->listSessionTypes(); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_detail_session_type() + { + Http::fake([ + 'meetings/sessionTypes/fake_session_type_id' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeDetailSessionType() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $session_type_detail = $laravel_webex->meeting()->detailSessionType('fake_session_type_id'); + + $this->assertInstanceOf(Meeting::class, $session_type_detail); + $this->assertEquals('fake_id', $session_type_detail->id); + } + + public function test_error_on_meeting_detail_session_types() + { + Http::fake([ + 'meetings/sessionTypes/fake_session_type_id' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeDetailSessionTypes(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->detailSessionType('fake_session_type_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_detail_registration_form() + { + Http::fake([ + 'meetings/fake_meeting_id/registration' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeDetailRegistrationForm() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $registration_form_detail = $laravel_webex->meeting()->detailRegistrationForm('fake_meeting_id'); + + $this->assertInstanceOf(Meeting::class, $registration_form_detail); + $this->assertEquals('fake_id', $registration_form_detail->id); + } + + public function test_error_on_meeting_detail_registration_form() + { + Http::fake([ + 'meetings/fake_meeting_id/registration' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeDetailRegistrationForm(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->detailRegistrationForm('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_update_registration_form() + { + Http::fake([ + 'meetings/fake_meeting_id/registration' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeUpdateRegistrationForm() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $updated_registration_form = $laravel_webex->meeting()->updateRegistrationForm('fake_meeting_id'); + + $this->assertInstanceOf(Meeting::class, $updated_registration_form); + $this->assertEquals('fake_id', $updated_registration_form->id); + } + + public function test_error_on_meeting_update_registration_form() + { + Http::fake([ + 'meetings/fake_meeting_id/registration' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeUpdateRegistrationForm(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->updateRegistrationForm('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_destroy_registration_form() + { + Http::fake([ + 'meetings/fake_meeting_id/registration' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeDestroyRegistrationForm() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $delete_response = $laravel_webex->meeting()->destroyRegistrationForm('fake_meeting_id'); + + $this->assertEquals('Meeting Registration Form deleted', $delete_response); + } + + public function test_error_on_meeting_destroy_registration_form() + { + Http::fake([ + 'meetings/fake_meeting_id/registration' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeDestroyRegistrationForm(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->destroyRegistrationForm('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_register() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeRegister() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $register = $laravel_webex->meeting()->register('fake_meeting_id', 'fake_first_name', 'fake_last_name', 'fake_email'); + + $this->assertInstanceOf(Meeting::class, $register); + $this->assertEquals('fake_id', $register->id); + } + + public function test_error_on_meeting_register() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeRegister(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->register('fake_meeting_id', 'fake_first_name', 'fake_last_name', 'fake_email'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_batch_register() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants/bulkInsert' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeBatchRegister() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $batch_register = $laravel_webex->meeting()->batchRegister('fake_meeting_id'); + + $this->assertInstanceOf(Meeting::class, $batch_register); + $this->assertEquals('fake_id', $batch_register->id); + } + + public function test_error_on_meeting_batch_register() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants/bulkInsert' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeBatchRegister(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->batchRegister('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_detail_information_for_registrant() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants/fake_registrant_id' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeDetailInformationForRegistrant() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $information_for_registrant_details = $laravel_webex->meeting()->detailInformationForRegistrant('fake_meeting_id', 'fake_registrant_id'); + + $this->assertInstanceOf(Meeting::class, $information_for_registrant_details); + $this->assertEquals('fake_id', $information_for_registrant_details->id); + } + + public function test_error_on_meeting_detail_information_for_registrant() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants/fake_registrant_id' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeDetailInformationForRegistrant(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->detailInformationForRegistrant('fake_meeting_id', 'fake_registrant_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_list_registrants() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeListRegistrants() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $registrants = $laravel_webex->meeting()->listRegistrants('fake_meeting_id'); + + $this->assertCount(2, $registrants); + + $single_registrant = null; + foreach ($registrants as $registrant) { + $this->assertInstanceOf(Meeting::class, $registrant); + $single_registrant = $registrant; + } + + $this->assertEquals('fake_id', $single_registrant->id); + } + + public function test_error_on_meeting_list_registrants() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeListRegistrants(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->listRegistrants('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_query_registrants() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants/query' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeQueryRegistrants() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $query_registrants = $laravel_webex->meeting()->queryRegistrants('fake_meeting_id', ['fake_email_1', 'fake_email_2',]); + + $this->assertInstanceOf(Meeting::class, $query_registrants); + $this->assertEquals('fake_id', $query_registrants->id); + } + + public function test_error_on_meeting_query_registrants() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants/query' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeQueryRegistrants(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->queryRegistrants('fake_meeting_id', ['fake_email_1', 'fake_email_2',]); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_batch_update_registrants_status() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants/fake_status_op_type' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeUpdateRegistrantsStatus() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $updated_registrants_status = $laravel_webex->meeting()->batchUpdateRegistrantsStatus('fake_meeting_id', 'fake_status_op_type'); + + $this->assertInstanceOf(Meeting::class, $updated_registrants_status); + $this->assertEquals('fake_id', $updated_registrants_status->id); + } + + public function test_error_on_meeting_batch_update_registrants_status() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants/fake_status_op_type' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeUpdateRegistrantsStatus(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->batchUpdateRegistrantsStatus('fake_meeting_id', 'fake_status_op_type'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_destroy_registrant() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants/fake_registrant_id' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeDestroyRegistrant() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $delete_response = $laravel_webex->meeting()->destroyRegistrant('fake_meeting_id', 'fake_registrant_id'); + + $this->assertEquals('Meeting Registrant deleted', $delete_response); + } + + public function test_error_on_meeting_destroy_registrant() + { + Http::fake([ + 'meetings/fake_meeting_id/registrants/fake_registrant_id' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeDestroyRegistrant(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->destroyRegistrant('fake_meeting_id', 'fake_registrant_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_update_simultaneous_interpretation() + { + Http::fake([ + 'meetings/fake_meeting_id/simultaneousInterpretation' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeUpdateSimultaneousInterpretation() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $updated_simultaneous_interpretation= $laravel_webex->meeting()->updateSimultaneousInterpretation('fake_meeting_id', 'fake_enabled'); + + $this->assertInstanceOf(Meeting::class, $updated_simultaneous_interpretation); + $this->assertEquals('fake_id', $updated_simultaneous_interpretation->id); + } + + public function test_error_on_meeting_update_simultaneous_interpretation() + { + Http::fake([ + 'meetings/fake_meeting_id/simultaneousInterpretation' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeUpdateSimultaneousInterpretation(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->updateSimultaneousInterpretation('fake_meeting_id', 'fake_enabled'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_create_interpreter() + { + Http::fake([ + 'meetings/fake_meeting_id/interpreters' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeCreateInterpreter() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $new_interpreter_details = $laravel_webex->meeting()->createInterpreter('fake_meeting_id', 'fake_language_code_1', 'fake_language_code_2'); + + $this->assertInstanceOf(Meeting::class, $new_interpreter_details); + $this->assertEquals('fake_id', $new_interpreter_details->id); + } + + public function test_error_on_meeting_create_interpreter() + { + Http::fake([ + 'meetings/fake_meeting_id/interpreters' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeCreateInterpreter(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->createInterpreter('fake_meeting_id', 'fake_language_code_1', 'fake_language_code_2'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_detail_interpreter() + { + Http::fake([ + 'meetings/fake_meeting_id/interpreters/fake_interpreter_id' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeDetailInterpreter() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $interpreter_details = $laravel_webex->meeting()->detailInterpreter('fake_meeting_id', 'fake_interpreter_id'); + + $this->assertInstanceOf(Meeting::class, $interpreter_details); + $this->assertEquals('fake_id', $interpreter_details->id); + } + + public function test_error_on_meeting_detail_interpreter() + { + Http::fake([ + 'meetings/fake_meeting_id/interpreters/fake_interpreter_id' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeDetailInterpreter(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->detailInterpreter('fake_meeting_id', 'fake_interpreter_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_list_interpreters() + { + Http::fake([ + 'meetings/fake_meeting_id/interpreters' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeListInterpreters() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $interpreters = $laravel_webex->meeting()->listInterpreters('fake_meeting_id'); + + $this->assertCount(2, $interpreters); + + $single_interpreter = null; + foreach ($interpreters as $interpreter) { + $this->assertInstanceOf(Meeting::class, $interpreter); + $single_interpreter = $interpreter; + } + + $this->assertEquals('fake_id', $single_interpreter->id); + } + + public function test_error_on_meeting_list_interpreters() + { + Http::fake([ + 'meetings/fake_meeting_id/interpreters' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeListInterpreters(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->listInterpreters('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_update_interpreter() + { + Http::fake([ + 'meetings/fake_meeting_id/interpreters/fake_interpreter_id' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeUpdateInterpreters() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $updated_interpreter = $laravel_webex->meeting()->updateInterpreter('fake_meeting_id', 'fake_interpreter_id', 'fake_language_code_1', 'fake_language_code_2'); + + $this->assertInstanceOf(Meeting::class, $updated_interpreter); + $this->assertEquals('fake_id', $updated_interpreter->id); + } + + public function test_error_on_meeting_update_interpreter() + { + Http::fake([ + 'meetings/fake_meeting_id/interpreters/fake_interpreter_id' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeUpdateInterpreters(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->updateInterpreter('fake_meeting_id', 'fake_interpreter_id', 'fake_language_code_1', 'fake_language_code_2'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_destroy_interpreter() + { + Http::fake([ + 'meetings/fake_meeting_id/interpreters/fake_interpreter_id' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeDestroyInterpreter() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $delete_response = $laravel_webex->meeting()->destroyInterpreter('fake_meeting_id', 'fake_interpreter_id'); + + $this->assertEquals('Meeting Interpreter deleted', $delete_response); + } + + public function test_error_on_meeting_destroy_interpreter() + { + Http::fake([ + 'meetings/fake_meeting_id/interpreters/fake_interpreter_id' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeDestroyInterpreter(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->destroyInterpreter('fake_meeting_id', 'fake_interpreter_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_list_breakout_sessions() + { + Http::fake([ + 'meetings/fake_meeting_id/breakoutSessions' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeListBreakoutSessions() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $breakout_sessions = $laravel_webex->meeting()->listBreakoutSessions('fake_meeting_id'); + + $this->assertCount(2, $breakout_sessions); + + $single_breakout_session = null; + foreach ($breakout_sessions as $breakout_session) { + $this->assertInstanceOf(Meeting::class, $breakout_session); + $single_breakout_session = $breakout_session; + } + + $this->assertEquals('fake_id', $single_breakout_session->id); + } + + public function test_error_on_meeting_list_breakout_sessions() + { + Http::fake([ + 'meetings/fake_meeting_id/breakoutSessions' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeListBreakoutSession(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->listBreakoutSessions('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_update_breakout_sessions() + { + Http::fake([ + 'meetings/fake_meeting_id/breakoutSessions' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeUpdateBreakoutSession() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $updated_breakout_session = $laravel_webex->meeting()->updateBreakoutSessions('fake_meeting_id'); + + $this->assertInstanceOf(Meeting::class, $updated_breakout_session); + $this->assertEquals('fake_id', $updated_breakout_session->id); + } + + public function test_error_on_meeting_update_breakout_sessions() + { + Http::fake([ + 'meetings/fake_meeting_id/breakoutSessions' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeUpdateBreakoutSession(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->updateBreakoutSessions('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_destroy_breakout_sessions() + { + Http::fake([ + 'meetings/fake_meeting_id/breakoutSessions' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeDestroyBreakoutSession() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $delete_response = $laravel_webex->meeting()->destroyBreakoutSessions('fake_meeting_id'); + + $this->assertEquals('Meeting Breakout Sessions deleted', $delete_response); + } + + public function test_error_on_meeting_destroy_breakout_sessions() + { + Http::fake([ + 'meetings/fake_meeting_id/breakoutSessions' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeDestroyBreakoutSessions(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->destroyBreakoutSessions('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_detail_survey() + { + Http::fake([ + 'meetings/fake_meeting_id/survey' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeDetailSurvey() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $survey_details = $laravel_webex->meeting()->detailSurvey('fake_meeting_id'); + + $this->assertInstanceOf(Meeting::class, $survey_details); + $this->assertEquals('fake_id', $survey_details->id); + } + + public function test_error_on_meeting_detail_survey() + { + Http::fake([ + 'meetings/fake_meeting_id/survey' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeDetailSurvey(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->detailSurvey('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_list_survey_results() + { + Http::fake([ + 'meetings/fake_meeting_id/surveyResults' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeListSurveyResults() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $survey_results = $laravel_webex->meeting()->listSurveyResults('fake_meeting_id'); + + $this->assertCount(2, $survey_results); + + $single_survey_result = null; + foreach ($survey_results as $survey_result) { + $this->assertInstanceOf(Meeting::class, $survey_result); + $single_survey_result = $survey_result; + } + + $this->assertEquals('fake_id', $single_survey_result->id); + } + + public function test_error_on_meeting_list_survey_results() + { + Http::fake([ + 'meetings/fake_meeting_id/surveyResults' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeListSurveyResults(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->listSurveyResults('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_detail_survey_links() + { + Http::fake([ + 'meetings/fake_meeting_id/surveyLinks' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeDetailSurveyLinks() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $survey_links_details = $laravel_webex->meeting()->detailSurveyLinks('fake_meeting_id'); + + $this->assertInstanceOf(Meeting::class, $survey_links_details); + $this->assertEquals('fake_id', $survey_links_details->id); + } + + public function test_error_on_meeting_detail_survey_links() + { + Http::fake([ + 'meetings/fake_meeting_id/surveyLinks' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeDetailSurveyLinks(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->detailSurveyLinks('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_create_invitation_sources() + { + Http::fake([ + 'meetings/fake_meeting_id/invitationSources' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeCreateInvitationSources() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $new_invitation_sources_details = $laravel_webex->meeting()->createInvitationSources('fake_meeting_id'); + + $this->assertInstanceOf(Meeting::class, $new_invitation_sources_details); + $this->assertEquals('fake_id', $new_invitation_sources_details->id); + } + + public function test_error_on_meeting_create_invitation_sources() + { + Http::fake([ + 'meetings/fake_meeting_id/invitationSources' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeCreateInvitationSources(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->createInvitationSources('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_list_invitation_sources() + { + Http::fake([ + 'meetings/fake_meeting_id/invitationSources' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeListInvitationSources() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $invitation_sources = $laravel_webex->meeting()->listInvitationSources('fake_meeting_id'); + + $this->assertCount(2, $invitation_sources); + + $single_invitation_source = null; + foreach ($invitation_sources as $invitation_source) { + $this->assertInstanceOf(Meeting::class, $invitation_source); + $single_invitation_source = $invitation_source; + } + + $this->assertEquals('fake_id', $single_invitation_source->id); + } + + public function test_error_on_meeting_list_invitation_sources() + { + Http::fake([ + 'meetings/fake_meeting_id/invitationSources' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeListInvitationSources(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->listInvitationSources('fake_meeting_id'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_list_tracking_codes() + { + Http::fake([ + 'meetings/trackingCodes' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeListTrackingCodes() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $tracking_codes = $laravel_webex->meeting()->listTrackingCodes('fake_service'); + + $this->assertCount(2, $tracking_codes); + + $single_tracking_code = null; + foreach ($tracking_codes as $tracking_code) { + $this->assertInstanceOf(Meeting::class, $tracking_code); + $single_tracking_code = $tracking_code; + } + + $this->assertEquals('fake_id', $single_tracking_code->id); + } + + public function test_error_on_meeting_list_tracking_codes() + { + Http::fake([ + 'meetings/trackingCodes' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeListTrackingCodes(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->listTrackingCodes('fake_service'); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } + + public function test_meetings_reassign_to_new_host() + { + Http::fake([ + 'meetings/reassignHost' => Http::response( + (new MeetingsFakeResponse())->getMeetingsFakeReassignToNewHost() + ), + ]); + + $laravel_webex = new LaravelWebex(); + $reassign_to_new_host = $laravel_webex->meeting()->reassignToNewHost('fake_host_email', ['fake_meeting_id_1', 'fake_meeting_id_2']); + + $this->assertInstanceOf(Meeting::class, $reassign_to_new_host); + $this->assertEquals('fake_id', $reassign_to_new_host->id); + } + + public function test_error_on_meeting_reassign_to_new_host() + { + Http::fake([ + 'meetings/reassignHost' => Http::response( + (new MeetingsFakeResponse())->getErrorOnMeetingsFakeReassignToNewHost(), + 401 + ), + ]); + + $laravel_webex = new LaravelWebex(); + $error_meeting = $laravel_webex->meeting()->reassignToNewHost('fake_host_email', ['fake_meeting_id_1', 'fake_meeting_id_2']); + + $this->assertInstanceOf(Error::class, $error_meeting); + $this->assertEquals('fake_message', $error_meeting->message); + $this->assertIsArray($error_meeting->errors); + $this->assertEquals('fake_trackingId', $error_meeting->trackingId); + } }