Commit f9bb1e21 by Carsten Brandt

fixed elasticsearch test break

parent f23ba6cb
......@@ -445,7 +445,15 @@ class ActiveRecordTest extends ElasticSearchTestCase
public function testScriptFields()
{
$orderItems = OrderItem::find()->fields(['quantity', 'subtotal', 'total' => ['script' => "doc['quantity'].value * doc['subtotal'].value"]])->all();
$orderItems = OrderItem::find()->fields([
'quantity',
'subtotal',
'total' => [
'script' => "doc['quantity'].value * doc['subtotal'].value",
'lang' => 'groovy',
]
])->all();
$this->assertNotEmpty($orderItems);
foreach($orderItems as $item) {
$this->assertEquals($item->subtotal * $item->quantity, $item->total);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment