@@ 65-72 (lines=8) @@ | ||
62 | /** |
|
63 | * @group unit |
|
64 | */ |
|
65 | public function testItsNotPossibleToMixWeightFieldAndScript(): void |
|
66 | { |
|
67 | $agg = new WeightedAvg('weighted'); |
|
68 | $agg->setWeight('weight'); |
|
69 | ||
70 | $this->expectExceptionObject(new InvalidException('Weighted Average aggregation with a weight mixing field and script is not possible.')); |
|
71 | $agg->setWeightScript('doc.weight.value + 1'); |
|
72 | } |
|
73 | ||
74 | /** |
|
75 | * @group unit |
|
@@ 77-84 (lines=8) @@ | ||
74 | /** |
|
75 | * @group unit |
|
76 | */ |
|
77 | public function testItsNotPossibleToMixWeightScriptAndField(): void |
|
78 | { |
|
79 | $agg = new WeightedAvg('weighted'); |
|
80 | $agg->setWeightScript('doc.weight.value + 1'); |
|
81 | ||
82 | $this->expectExceptionObject(new InvalidException('Weighted Average aggregation with a weight mixing field and script is not possible.')); |
|
83 | $agg->setWeight('weight'); |
|
84 | } |
|
85 | ||
86 | protected function _getIndexForTest(): Index |
|
87 | { |