public function testIsValidWithValidTransitDepartureTimeAndArrivalTime()
 {
     $this->directionsRequest->setDestination('foo');
     $this->directionsRequest->setOrigin('bar');
     $this->directionsRequest->setTravelMode(TravelMode::TRANSIT);
     $this->directionsRequest->setArrivalTime(new DateTime());
     $this->directionsRequest->setDepartureTime(new DateTime());
     $this->assertTrue($this->directionsRequest->isValid());
 }
예제 #2
0
 public function testRouteWithDirectionsRequestAndTransitModeAndDepartureTime()
 {
     $request = new DirectionsRequest();
     $request->setOrigin('601-625 Ashbury Street, San Francisco');
     $request->setDestination('Bike Route 95, San Francisco');
     $request->setTravelMode(TravelMode::TRANSIT);
     $request->setDepartureTime(new DateTime());
     $response = $this->directions->route($request);
     $this->assertSame(DirectionsStatus::OK, $response->getStatus());
     $this->assertNotEmpty($response->getRoutes());
 }