/** * @dataProvider attendeesByMeetingProvider */ public function testGetAttendeesByMeeting($meetingInstanceKey, \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("meetings/{$meetingInstanceKey}/attendees"), $this->attributeEqualTo('data', array('startDate' => $startDate->format(MeetingService::DATE_FORMAT_INPUT), 'endDate' => $endDate->format(MeetingService::DATE_FORMAT_INPUT)))); $groupService = new MeetingService($client); $actualResponse = $groupService->getAttendeesByMeeting($meetingInstanceKey, $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]); }