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

testRandomAlnum() public method

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