Beispiel #1
0
 public function testWithinMiles()
 {
     $query = new Query("TestObject");
     $query->withinMiles('location', new GeoPoint(39.9, 116.4), 0.5);
     $out = $query->encode();
     $expect = json_encode(array('location' => array('$nearSphere' => array('__type' => 'GeoPoint', 'latitude' => 39.9, 'longitude' => 116.4), '$maxDistanceInMiles' => 0.5)));
     $this->assertEquals($expect, $out['where']);
 }