/** * @group unit */ public function testSetTimezone() { $agg = new DateHistogram('hist', 'created', '1h'); $agg->setTimezone('-02:30'); $expected = array('date_histogram' => array('field' => 'created', 'interval' => '1h', 'time_zone' => '-02:30')); $this->assertEquals($expected, $agg->toArray()); $this->assertInstanceOf('Elastica\\Aggregation\\DateHistogram', $agg->setTimezone('-02:30')); }