class SystemTest extends TestCase
{
- private function assertGuid($guid, $length)
+ private function assertGuid($guid, $length, $prefix = '')
{
print $guid;
- $this->assertRegExp("/^[a-z0-9]{" . $length . "}?$/", $guid);
+ $length -= strlen($prefix);
+ $this->assertRegExp("/^" . $prefix . "[a-z0-9]{" . $length . "}?$/", $guid);
}
function testGuidWithoutParameter()
$guid = System::createGUID(64);
$this->assertGuid($guid, 64);
}
+
+ function testGuidWithPrefix() {
+ $guid = System::createGUID(23, 'test');
+ $this->assertGuid($guid, 23, 'test');
+ }
}
\ No newline at end of file