/** * @dataProvider loopsProvider * @param LoopExtendedInterface|LoopModelInterface|mixed $loop */ public function testApiAddPeriodicTimer_AddsPeriodicTimer($loop) { $cnt = 0; $loop->addPeriodicTimer(0.001, function () use($loop, &$cnt) { $cnt++; if ($cnt == 5) { $loop->stop(); } }); $loop->start(); $this->assertEquals(5, $cnt); unset($loop); }