@@ 41-48 (lines=8) @@ | ||
38 | /** |
|
39 | * @group unit |
|
40 | */ |
|
41 | public function testItsNotPossibleToMixValueFieldAndScript(): void |
|
42 | { |
|
43 | $agg = new WeightedAvg('weighted'); |
|
44 | $agg->setValue('price'); |
|
45 | ||
46 | $this->expectExceptionObject(new InvalidException('Weighted Average aggregation with a value mixing field and script is not possible.')); |
|
47 | $agg->setValueScript('doc.price.value + 1'); |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * @group unit |
|
@@ 53-60 (lines=8) @@ | ||
50 | /** |
|
51 | * @group unit |
|
52 | */ |
|
53 | public function testItsNotPossibleToMixValueScriptAndField(): void |
|
54 | { |
|
55 | $agg = new WeightedAvg('weighted'); |
|
56 | $agg->setValueScript('doc.price.value + 1'); |
|
57 | ||
58 | $this->expectExceptionObject(new InvalidException('Weighted Average aggregation with a value mixing field and script is not possible.')); |
|
59 | $agg->setValue('price'); |
|
60 | } |
|
61 | ||
62 | /** |
|
63 | * @group unit |