/** * @param Meeting $meeting * @return Meeting */ public function createMeeting(Meeting $meeting) { $meetingArray = $meeting->toArrayForApi(); $jsonBody = $this->client->sendRequest('POST', $this->endpoint, null, false, $meetingArray); // Merge attributes returned in response to existing Meeting instance $meeting->parseFromJson($jsonBody[0]); return $meeting; }
/** * @dataProvider historicalMeetingProvider */ public function testParseFromJsonHistorical($responseArray) { $meetingObject = new Meeting(); $meetingObject->parseFromJson($responseArray); $this->assertThat($meetingObject, $this->attributeEqualTo('uniqueMeetingId', $responseArray['uniqueMeetingId'])); $this->assertThat($meetingObject, $this->attributeEqualTo('meetingId', $responseArray['meetingId'])); $this->assertThat($meetingObject, $this->attributeEqualTo('subject', $responseArray['subject'])); $this->assertThat($meetingObject, $this->attributeEqualTo('organizerKey', $responseArray['organizerkey'])); $this->assertThat($meetingObject, $this->attributeEqualTo('meetingInstanceKey', $responseArray['meetingInstanceKey'])); $this->assertThat($meetingObject, $this->attributeEqualTo('duration', $responseArray['duration'])); $this->assertThat($meetingObject, $this->attributeEqualTo('numberOfAttendees', $responseArray['numAttendees'])); $this->assertThat($this->getObjectAttribute($meetingObject, 'date'), $this->isInstanceOf('\\DateTime')); }