random() public method

public random ( $seed = null )
Esempio n. 1
0
 public function test_cycle()
 {
     $elements = array(1, 2, 3);
     $cycler = new Helper\Cycler($elements);
     $this->assertTrue($cycler instanceof \IteratorAggregate);
     $this->assertEquals(1, $cycler->next());
     $this->assertEquals(2, $cycler->next());
     $this->assertEquals(3, $cycler->next());
     $this->assertTrue(in_array($cycler->random(), $elements));
 }