public function testWithinRadians() { $query = new Query("TestObject"); $query->withinRadians('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), '$maxDistanceInRadians' => 0.5))); $this->assertEquals($expect, $out['where']); }