random() public method

That means a result will always be less than 1 and greater or equal to 0, the same way Math.random() works in JavaScript. See Math.randomInt(min, max) for a function that returns random integer numbers from a given interval.
public random ( ) : float
return float A random floating point number between 0 (inclusive) and 1 (exclusive), that is from [0, 1)
 /**
  * @test
  */
 public function randomReturnsARandomResultFromZeroToOneExclusive()
 {
     $helper = new MathHelper();
     $r1 = $helper->random();
     $atLeastOneRandomResult = false;
     for ($i = 0; $i < 100; $i++) {
         $ri = $helper->random();
         if ($ri !== $r1) {
             $atLeastOneRandomResult = true;
         }
         $this->assertLessThan(1.0, $ri, 'Result should be less than 1');
         $this->assertGreaterThanOrEqual(0.0, $ri, 'Result should be greater than 0');
     }
     $this->assertTrue($atLeastOneRandomResult, 'random() should return a random result');
 }