// Test custom namespace
$uuid1 =
$uuidFactory->
nameBased('6f80c216-0492-4421-bd82-c10ab929ae84'
)->
create('foo'
);
$this->
assertInstanceOf(UuidV5::
class,
$uuid1);
$this->
assertSame('d521ceb7-3e31-5954-b873-92992c697ab9',
(string) $uuid1);
// Test default namespace override
$uuid2 =
$uuidFactory->
nameBased(Uuid::
v4())->
create('foo'
);
$this->
assertFalse($uuid1->
equals($uuid2));
// Test version override
$uuidFactory =
new UuidFactory(6, 6, 3, 4,
new NilUuid(), '6f80c216-0492-4421-bd82-c10ab929ae84'
);
$uuid3 =
$uuidFactory->
nameBased()->
create('foo'
);
$this->
assertInstanceOf(UuidV3::
class,
$uuid3);
} public function testCreateTimedDefaultVersion() { $this->
assertInstanceOf(UuidV6::
class,
(new UuidFactory())->
timeBased()->
create());
$this->
assertInstanceOf(UuidV1::
class,
(new UuidFactory(6, 1
))->
timeBased()->
create());
} public function testCreateTimed() {