5 use MediaWikiCoversValidator;
26 "UID has the right number of digits" );
28 "UID has the right number of bits" );
31 for ( $i = 0; $i < 300; $i++ ) {
39 foreach ( $ids as $id ) {
45 $timestamp_bin =
substr( $id_bin, 0, $tbits );
46 $last_timestamp_bin =
substr( $lastId_bin, 0, $tbits );
51 "timestamp ($timestamp_bin) of current ID ($id_bin) >= timestamp ($last_timestamp_bin) " .
52 "of prior one ($lastId_bin)" );
54 $hostbits_bin =
substr( $id_bin, -$hostbits );
55 $last_hostbits_bin =
substr( $lastId_bin, -$hostbits );
61 "Host ID ($hostbits_bin) of current ID ($id_bin) is same as host ID ($last_hostbits_bin) " .
62 "of prior one ($lastId_bin)." );
75 [
'newTimestampedUID128', 39, 128, 46, 48 ],
76 [
'newTimestampedUID128', 39, 128, 46, 48 ],
77 [
'newTimestampedUID88', 27, 88, 46, 32 ],
87 for ( $i = 0; $i < 100; $i++ ) {
90 preg_match(
'!^[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$!', $id ),
91 "UID $id has the right format" );
96 preg_match(
'!^[0-9a-f]{12}1[0-9a-f]{3}[89ab][0-9a-f]{15}$!', $id ),
97 "UID $id has the right format" );
101 preg_match(
'!^[0-9a-f]{12}1[0-9a-f]{3}[89ab][0-9a-f]{15}$!', $id ),
102 "UID $id has the right format" );
113 for ( $i = 0; $i < 100; $i++ ) {
117 preg_match(
'!^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$!', $id ),
118 "UID $id has the right format" );
128 for ( $i = 0; $i < 100; $i++ ) {
131 preg_match(
'!^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$!', $id ),
132 "UID $id has the right format" );
140 for ( $i = 0; $i < 100; $i++ ) {
143 preg_match(
'!^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$!', $id ),
144 "UID $id has the right format" );
168 foreach ( $ids as $id ) {
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
static provider_testTimestampedUID()
array( method, length, bits, hostbits ) NOTE: When adding a new method name here please update the co...
testRawUUIDv4QuickRand()
UIDGenerator::newRawUUIDv4.
testNewSequentialIDs()
UIDGenerator::newSequentialPerNodeIDs UIDGenerator::getSequentialPerNodeIDs.
testUUIDv1()
UIDGenerator::newUUIDv1 UIDGenerator::getUUIDv1.
testNewSequentialID()
UIDGenerator::newSequentialPerNodeID.
testTimestampedUID( $method, $digitlen, $bits, $tbits, $hostbits)
Test that generated UIDs have the expected properties.
testRawUUIDv4()
UIDGenerator::newRawUUIDv4.
testUUIDv4()
UIDGenerator::newUUIDv4.
static newRawUUIDv1()
Return an RFC4122 compliant v1 UUID.
static newSequentialPerNodeID( $bucket, $bits=48, $flags=0)
Return an ID that is sequential only for this node and bucket.
static newSequentialPerNodeIDs( $bucket, $bits, $count, $flags=0)
Return IDs that are sequential only for this node and bucket.
static newRawUUIDv4( $flags=0)
Return an RFC4122 compliant v4 UUID.
static newUUIDv4( $flags=0)
Return an RFC4122 compliant v4 UUID.
static newUUIDv1()
Return an RFC4122 compliant v1 UUID.
static unitTestTearDown()
Cleanup resources when tearing down after a unit test.