Автор: Markus Malkusch (markus@malkusch.de)
Пример #1
0
 /**
  * Tests that the code is executed more times.
  *
  * @test
  */
 public function testIteration()
 {
     $i = 0;
     $loop = new Loop();
     $loop->execute(function () use($loop, &$i) {
         $i++;
         if ($i > 1) {
             $loop->end();
         }
     });
     $this->assertEquals(2, $i);
 }