19 declare(strict_types=1);
21 require_once(
"vendor/composer/vendor/autoload.php");
30 private const VALID_UUID4 =
'/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/';
32 private const UUID4 =
'f47ac10b-58cc-4372-a567-0e02b2c3d479';
33 private const NO_UUID =
'lorem ipsum dolor';
49 $uuid = $factory->uuid4();
51 $this->assertMatchesRegularExpression(self::VALID_UUID4, $uuid->toString());
60 $uuid = $factory->uuid4AsString();
62 $this->assertIsString($uuid);
63 $this->assertMatchesRegularExpression(self::VALID_UUID4, $uuid);
72 $uuid = $factory->fromString(self::UUID4);
74 $this->assertMatchesRegularExpression(self::VALID_UUID4, $uuid->toString());
75 $this->assertEquals(self::UUID4, $uuid->toString());
83 $this->expectException(InvalidUuidStringException::class);
86 $factory->fromString(self::NO_UUID);
test_from_string()
test_init
test_from_illegal_string()
test_init
test_uuid4_string()
test_init