/**
  * Tests if parameters can be passed to constructor.
  */
 public function testConstructorFilter()
 {
     $aggregation = new GeoDistanceAggregation('test', 'fieldName', 'originValue', [['from' => 'value'], ['to' => 'value'], ['from' => 'value', 'to' => 'value2']], 'unitValue', 'distanceTypeValue');
     $this->assertSame(['geo_distance' => ['field' => 'fieldName', 'origin' => 'originValue', 'unit' => 'unitValue', 'distance_type' => 'distanceTypeValue', 'ranges' => [['from' => 'value'], ['to' => 'value'], ['from' => 'value', 'to' => 'value2']]]], $aggregation->toArray());
 }