Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12741026
UUIDTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
636 B
Referenced Files
None
Subscribers
None
UUIDTest.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Keruald\OmniTools\Tests\Identifiers
;
use
Keruald\OmniTools\Identifiers\UUID
;
use
Phpunit\Framework\TestCase
;
class
UUIDTest
extends
TestCase
{
public
function
testUUIDv4
()
:
void
{
$uuid
=
UUID
::
UUIDv4
();
$this
->
assertEquals
(
36
,
strlen
(
$uuid
),
"UUID size must be 36 characters."
);
$re
=
"/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/"
;
$this
->
assertRegExp
(
$re
,
$uuid
);
}
public
function
testUUIDv4AreUnique
()
:
void
{
$this
->
assertNotEquals
(
UUID
::
UUIDv4
(),
UUID
::
UUIDv4
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 16, 13:15 (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3158024
Default Alt Text
UUIDTest.php (636 B)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment