lithium\tests\cases\util\StringTest::testRandom64Generator PHP Method

testRandom64Generator() public method

Tests the random number generator with base64 encoding.
    public function testRandom64Generator()
    {
        $check = array();
        $count = 25;
        $pattern = "/^[0-9A-Za-z\\.\\/]{11}\$/";
        for ($i = 0; $i < $count; $i++) {
            $result = String::random(8, array('encode' => String::ENCODE_BASE_64));
            $this->assertPattern($pattern, $result);
            $this->assertFalse(in_array($result, $check));
            $check[] = $result;
        }
    }