Esempio n. 1
0
 /**
  * @dataProvider groupKey
  */
 public function testGetScheduledMeetings($groupKey)
 {
     $meetings = $this->groupService->getMeetingsByGroup($groupKey);
     $this->assertNotEmpty($meetings);
     $actualMeeting = $meetings[0];
     $this->assertNotNull($actualMeeting);
     $this->assertInstanceOf('\\kenobi883\\GoToMeeting\\Models\\Meeting', $actualMeeting);
     $this->assertAttributeNotEmpty('groupName', $actualMeeting);
 }
Esempio n. 2
0
 /**
  * @dataProvider attendeesByGroupProvider
  */
 public function testGetAttendeesByGroup($groupKey, \DateTime $startDate, \DateTime $endDate, $responseArray)
 {
     $client = $this->getMockBuilder('Client')->setMethods(array('sendRequest'))->getMock();
     $client->method('sendRequest')->will($this->returnValue(array($responseArray)));
     $client->expects($this->once())->method('sendRequest')->with($this->stringContains('GET', false), $this->stringContains("groups/{$groupKey}/attendees"), $this->attributeEqualTo('data', array('startDate' => $startDate->format(MeetingService::DATE_FORMAT_INPUT), 'endDate' => $endDate->format(MeetingService::DATE_FORMAT_INPUT))));
     $groupService = new GroupService($client);
     $actualResponse = $groupService->getAttendeesByGroup($groupKey, $startDate, $endDate);
     $this->assertArrayHasKey('meetings', $actualResponse);
     $this->assertArrayHasKey('attendees', $actualResponse);
     $this->assertNotEmpty($actualResponse['meetings']);
     $this->assertInstanceOf('\\kenobi883\\GoToMeeting\\Models\\Meeting', $actualResponse['meetings'][0]);
     $this->assertNotEmpty($actualResponse['attendees']);
     $this->assertInstanceOf('\\kenobi883\\GoToMeeting\\Models\\Attendee', $actualResponse['attendees'][0]);
 }
Esempio n. 3
0
 /**
  * Create a new organizer in the specified group.
  *
  * @param int $groupKey
  * @param Organizer $organizer
  * @return Organizer with organizer key set from response
  */
 public function createOrganizer($groupKey, Organizer $organizer)
 {
     $groupService = new GroupService($this->client);
     return $groupService->createOrganizer($groupKey, $organizer);
 }