/** * {@inheritdoc} */ public function publish(array $metrics) { foreach ($metrics as $metric) { $this->publishMetric($metric); } if ($this->autoFlush) { $this->beberleiCollector->flush(); } }
function it_auto_flushes_by_default(Collector $beberleiCollector) { $this->publish([]); $beberleiCollector->flush()->shouldBeCalled(); }