public function testCompare() { $uuids =
[];
$uuids[] =
$b =
new Uuid('00000000-0000-0000-0000-00000000000b'
);
$uuids[] =
$a =
new Uuid('00000000-0000-0000-0000-00000000000a'
);
$uuids[] =
$d =
new Uuid('00000000-0000-0000-0000-00000000000d'
);
$uuids[] =
$c =
new Uuid('00000000-0000-0000-0000-00000000000c'
);
$this->
assertNotSame([$a,
$b,
$c,
$d],
$uuids);
usort($uuids,
static fn (Uuid
$a, Uuid
$b): int =>
$a->
compare($b));
$this->
assertSame([$a,
$b,
$c,
$d],
$uuids);
} /**
* @testWith ["00000000-0000-0000-0000-000000000000"]
* ["1111111111111111111111"]
* ["00000000000000000000000000"]
*/
public function testNilUuid(string
$uuid) {