mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Support both UUIDv4 and UUIDv7 in Security::getRandomUUID()
This commit is contained in:
parent
c01ba1d3cf
commit
f8ed6da4ed
2 changed files with 32 additions and 4 deletions
|
|
@ -83,6 +83,16 @@ class SecurityTest extends \Codeception\TestCase\Test
|
|||
{
|
||||
$this->assertRegExp($regex, Rhymix\Framework\Security::getRandomUUID());
|
||||
}
|
||||
for ($i = 0; $i < 10; $i++)
|
||||
{
|
||||
$this->assertRegExp($regex, Rhymix\Framework\Security::getRandomUUID(4));
|
||||
}
|
||||
|
||||
$regex = '/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/';
|
||||
for ($i = 0; $i < 10; $i++)
|
||||
{
|
||||
$this->assertRegExp($regex, Rhymix\Framework\Security::getRandomUUID(7));
|
||||
}
|
||||
}
|
||||
|
||||
public function testCompareStrings()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue