public function findRandomLine() { $desired_line = null; $random = new Random(); $i = 0; foreach ($this as $line) { if ($random->generateDigit(0, $i) < 1) { $desired_line = $line; } ++$i; } $this->rewind(); return $desired_line; }
public function testGenerateDigit_MinDigitLessThanMax() { $this->setExpectedException('Stalxed\\System\\Exception\\RangeException'); $random = new Random(); $random->generateDigit(3, 1); }