/**
  * Test toArray method.
  */
 public function testToArray()
 {
     $this->agg->setField('bar');
     $this->agg->setValues(['bar']);
     $this->assertSame(['agg_foo' => ['percentile_ranks' => ['field' => 'bar', 'values' => ['bar']]]], $this->agg->toArray());
 }