File tree 1 file changed +12
-12
lines changed
tests/Unit/Aggregation/Bucketing
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 12
12
namespace ONGR \ElasticsearchDSL \Tests \Unit \Aggregation \Bucketing ;
13
13
14
14
use ONGR \ElasticsearchDSL \Aggregation \Bucketing \AdjacencyMatrixAggregation ;
15
+ use ONGR \ElasticsearchDSL \Aggregation \Bucketing \FiltersAggregation ;
15
16
16
17
/**
17
18
* Unit test for adjacency matrix aggregation.
18
19
*/
19
20
class AdjacencyMatrixAggregationTest extends \PHPUnit \Framework \TestCase
20
21
{
21
- // /**
22
- // * Test if exception is thrown when not anonymous filter is without name.
23
- // *
24
- // * @expectedException \LogicException
25
- // * @expectedExceptionMessage In not anonymous filters filter name must be set.
26
- // */
27
- // public function testIfExceptionIsThrown()
28
- // {
29
- // $mock = $this->getMockBuilder('ONGR\ElasticsearchDSL\BuilderInterface')->getMock();
30
- // $aggregation = new FiltersAggregation('test_agg');
31
- // $aggregation->addFilter($mock);
32
- // }
22
+ /**
23
+ * Test if exception is thrown when not anonymous filter is without name.
24
+ */
25
+ public function testIfExceptionIsThrown ()
26
+ {
27
+ $ this ->expectException (\LogicException::class);
28
+ $ this ->expectExceptionMessage ("In not anonymous filters filter name must be set. " );
29
+ $ mock = $ this ->getMockBuilder ('ONGR\ElasticsearchDSL\BuilderInterface ' )->getMock ();
30
+ $ aggregation = new FiltersAggregation ('test_agg ' );
31
+ $ aggregation ->addFilter ($ mock );
32
+ }
33
33
34
34
/**
35
35
* Test GetArray method.
You can’t perform that action at this time.
0 commit comments