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

added significant terms aggregation test

parent c97b35aa
No related branches found
No related tags found
Loading
<?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\SignificantTermsAggregation;
/**
* Unit test for children aggregation.
*/
class SignificantTermsAggregationTest extends \PHPUnit_Framework_TestCase
{
/**
* Tests getType method.
*/
public function testSignificantTermsAggregationGetType()
{
$aggregation = new SignificantTermsAggregation('foo');
$result = $aggregation->getType();
$this->assertEquals('significant_terms', $result);
}
/**
* Tests getArray method.
*/
public function testSignificantTermsAggregationGetArray()
{
$mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\Aggregation\AbstractAggregation')
->disableOriginalConstructor()
->getMockForAbstractClass();
$aggregation = new SignificantTermsAggregation('foo', 'title');
$aggregation->addAggregation($mock);
$result = $aggregation->getArray();
$expected = ['field' => 'title'];
$this->assertEquals($expected, $result);
}
}
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