Skip to content
Snippets Groups Projects
Commit f3d96dd6 authored by Simonas Šerlinskas's avatar Simonas Šerlinskas
Browse files

Merge pull request #80 from einorler/nestedAggregation

removed the exception from nestedAggregation
parents d919bff6 9ce60d5c
No related branches found
No related tags found
No related merge requests found
......@@ -71,10 +71,6 @@ class NestedAggregation extends AbstractAggregation
*/
public function getArray()
{
if (count($this->getAggregations()) == 0) {
throw new \LogicException("Nested aggregation `{$this->getName()}` has no aggregations added");
}
return ['path' => $this->getPath()];
}
}
......@@ -16,18 +16,6 @@ use ONGR\ElasticsearchDSL\Aggregation\TermsAggregation;
class NestedAggregationTest extends \PHPUnit_Framework_TestCase
{
/**
* Test for nested aggregation toArray() method exception.
*
* @expectedException \LogicException
*/
public function testToArrayException()
{
$aggregation = new NestedAggregation('test_agg');
$aggregation->setPath('test_path');
$aggregation->toArray();
}
/**
* Test for nested aggregation toArray() method exception.
*/
......
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