File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
tests/Unit/Aggregation/Bucketing Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 1212namespace ONGR \ElasticsearchDSL \Tests \Unit \Aggregation \Bucketing ;
1313
1414use ONGR \ElasticsearchDSL \Aggregation \Bucketing \AdjacencyMatrixAggregation ;
15+ use ONGR \ElasticsearchDSL \Aggregation \Bucketing \FiltersAggregation ;
1516
1617/**
1718 * Unit test for adjacency matrix aggregation.
1819 */
1920class AdjacencyMatrixAggregationTest extends \PHPUnit \Framework \TestCase
2021{
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+ }
3333
3434 /**
3535 * Test GetArray method.
You can’t perform that action at this time.
0 commit comments