public function testIsValidWithInvalidWaypoint()
 {
     $waypoint = $this->getMock('Ivory\\GoogleMap\\Services\\Directions\\DirectionsWaypoint');
     $waypoint->expects($this->once())->method('isValid')->will($this->returnValue(false));
     $this->directionsRequest->setDestination('foo');
     $this->directionsRequest->setOrigin('bar');
     $this->directionsRequest->addWaypoint($waypoint);
     $this->assertFalse($this->directionsRequest->isValid());
 }
 public function testRouteWithDirectionsRequestAndStopoverWaypoint()
 {
     $waypoint = new DirectionsWaypoint();
     $waypoint->setLocation('Compiègne');
     $waypoint->setStopover(true);
     $request = new DirectionsRequest();
     $request->setOrigin('Lille');
     $request->addWaypoint($waypoint);
     $request->setDestination('Paris');
     $response = $this->directions->route($request);
     $this->assertSame(DirectionsStatus::OK, $response->getStatus());
     $this->assertNotEmpty($response->getRoutes());
 }