Eris\Generator\ChooseGeneratorTest::testUniformity PHP Method

testUniformity() public method

public testUniformity ( )
    public function testUniformity()
    {
        $generator = new ChooseGenerator(-10, 10000);
        $values = [];
        for ($i = 0; $i < 50; $i++) {
            $values[] = $generator($this->size, $this->rand);
        }
        $this->assertGreaterThan(40, count(array_filter($values, function ($n) {
            return $n->unbox() > 0;
        })), "The positive numbers should be a vast majority given the interval [-10, 10000]");
    }