Skip to content
Snippets Groups Projects
Commit 356af585 authored by Mantas's avatar Mantas
Browse files

added geo centroid aggregation test

parent 71bb60d5
No related branches found
No related tags found
No related merge requests found
<?php
/*
* This file is part of the ONGR package.
*
* (c) NFQ Technologies UAB <info@nfq.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace ONGR\ElasticsearchDSL\Tests\Aggregation;
use ONGR\ElasticsearchDSL\Aggregation\GeoCentroidAggregation;
/**
* Unit test for children aggregation.
*/
class GeoCentroidAggregationTest extends \PHPUnit_Framework_TestCase
{
/**
* Test if exception is thrown when field is not provided
*
* @expectedException \LogicException
*/
public function testGetArrayException()
{
$aggregation = new GeoCentroidAggregation('foo');
$aggregation->getArray();
}
/**
* Tests getType method.
*/
public function testGeoCentroidAggregationGetType()
{
$aggregation = new GeoCentroidAggregation('foo');
$this->assertEquals('geo_centroid', $aggregation->getType());
}
/**
* Tests getArray method.
*/
public function testGeoCentroidAggregationGetArray()
{
$aggregation = new GeoCentroidAggregation('foo', 'location');
$this->assertEquals(['field' => 'location'], $aggregation->getArray());
}
}
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