Skip to content
Snippets Groups Projects
Commit 642af5b6 authored by Aivaras Gotovskis's avatar Aivaras Gotovskis
Browse files

Test constructor arguments to GeoDistanceAggregationTest.

parent 6788a7e8
No related branches found
No related tags found
No related merge requests found
......@@ -112,4 +112,42 @@ class GeoDistanceAggregationTest extends \PHPUnit_Framework_TestCase
$result = $aggregation->getType();
$this->assertEquals('geo_distance', $result);
}
/**
* 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(
[
'agg_test' => [
'geo_distance' => [
'field' => 'fieldName',
'origin' => 'originValue',
'unit' => 'unitValue',
'distance_type' => 'distanceTypeValue',
'ranges' => [
['from' => 'value'],
['to' => 'value'],
['from' => 'value', 'to' => 'value2'],
],
],
],
],
$aggregation->toArray()
);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment