malkusch\lock\util\LoopTest::testIteration PHP Method

testIteration() public method

Tests that the code is executed more times.
public testIteration ( )
    public function testIteration()
    {
        $i = 0;
        $loop = new Loop();
        $loop->execute(function () use($loop, &$i) {
            $i++;
            if ($i > 1) {
                $loop->end();
            }
        });
        $this->assertEquals(2, $i);
    }