Skip to content
Snippets Groups Projects
Commit d3d4580c authored by Niels Nijens's avatar Niels Nijens
Browse files

Fix unit tests of FiltersAggregation

parent 1cf08b55
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,6 @@
namespace ONGR\ElasticsearchDSL\Tests\Aggregation;
use ONGR\ElasticsearchDSL\Aggregation\AbstractAggregation;
use ONGR\ElasticsearchDSL\Aggregation\FiltersAggregation;
use ONGR\ElasticsearchDSL\BuilderInterface;
......@@ -65,9 +64,6 @@ class FiltersAggregationTest extends \PHPUnit_Framework_TestCase
$filter = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface')
->setMethods(['toArray', 'getType'])
->getMockForAbstractClass();
$filter->expects($this->any())
->method('getType')
->willReturn('test_filter');
$filter->expects($this->any())
->method('toArray')
->willReturn(['test_field' => ['test_value' => 'test']]);
......@@ -79,17 +75,13 @@ class FiltersAggregationTest extends \PHPUnit_Framework_TestCase
'filters' => [
'filters' => [
'first' => [
'test_filter' => [
'test_field' => [
'test_value' => 'test',
],
'test_field' => [
'test_value' => 'test',
],
],
'second' => [
'test_filter' => [
'test_field' => [
'test_value' => 'test',
],
'test_field' => [
'test_value' => 'test',
],
],
],
......@@ -105,10 +97,8 @@ class FiltersAggregationTest extends \PHPUnit_Framework_TestCase
{
/** @var BuilderInterface|\PHPUnit_Framework_MockObject_MockObject $builderInterface1 */
$builderInterface1 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\BuilderInterface');
$builderInterface1->expects($this->any())->method('getType')->willReturn('type1');
/** @var BuilderInterface|\PHPUnit_Framework_MockObject_MockObject $builderInterface2 */
$builderInterface2 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\BuilderInterface');
$builderInterface2->expects($this->any())->method('getType')->willReturn('type2');
$aggregation = new FiltersAggregation(
'test',
......@@ -122,8 +112,8 @@ class FiltersAggregationTest extends \PHPUnit_Framework_TestCase
[
'filters' => [
'filters' => [
'filter1' => ['type1' => null],
'filter2' => ['type2' => null],
'filter1' => null,
'filter2' => null,
],
],
],
......@@ -143,8 +133,8 @@ class FiltersAggregationTest extends \PHPUnit_Framework_TestCase
[
'filters' => [
'filters' => [
['type1' => null],
['type2' => null],
null,
null,
],
],
],
......
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