Phalcon\Test\Unit\Text\TextRandomTest::testRandomNonZero PHP Method

testRandomNonZero() public method

Tests the random function with non zero
Since: 2014-09-29
Author: Nikolaos Dimopoulos ([email protected])
public testRandomNonZero ( )
    public function testRandomNonZero()
    {
        $this->specify("random with nonzero does not return correct results", function () {
            for ($i = 1; $i < 10; $i++) {
                $source = Text::random(Text::RANDOM_NOZERO, $i);
                expect(preg_match('/[1-9]+/', $source, $matches))->equals(1);
                expect($matches[0])->equals($source);
                expect(strlen($source))->equals($i);
            }
        });
    }