Ejemplo n.º 1
0
 public function testGetHistoricalMeetings()
 {
     $startDate = Carbon::now('UTC');
     $startDate->subMonth();
     $endDate = Carbon::now('UTC');
     $meetings = $this->meetingService->getHistoricalMeetings($startDate, $endDate);
     $this->assertNotEmpty($meetings);
     $actualMeeting = $meetings[0];
     $this->assertNotNull($actualMeeting);
     $this->assertInstanceOf('\\kenobi883\\GoToMeeting\\Models\\Meeting', $actualMeeting);
     $actualDate = Carbon::instance($actualMeeting->getDate());
     $this->assertTrue($actualDate->between($startDate, $endDate));
 }
Ejemplo n.º 2
0
 /**
  * @dataProvider singleMeetingProvider
  */
 public function testGetHistoricalMeetings($responseArray, $expectedMeeting)
 {
     $startDate = new \DateTime($responseArray['startTime']);
     $endDate = new \DateTime($responseArray['startTime']);
     $endDate->add(new \DateInterval('P1D'));
     $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'), $this->attributeEqualTo('data', array('history' => 'true', 'startDate' => $startDate->format(MeetingService::DATE_FORMAT_INPUT), 'endDate' => $endDate->format(MeetingService::DATE_FORMAT_INPUT))));
     $meetingService = new MeetingService($client);
     $meetings = $meetingService->getHistoricalMeetings($startDate, $endDate);
     $this->assertNotEmpty($meetings);
     $actualMeeting = $meetings[0];
     $this->assertNotNull($actualMeeting);
     $this->assertInstanceOf('\\kenobi883\\GoToMeeting\\Models\\Meeting', $actualMeeting);
     $this->assertEquals($expectedMeeting, $actualMeeting);
 }