2require_once(
"libs/composer/vendor/autoload.php");
4use PHPUnit\Framework\TestCase;
7use Ramsey\Uuid\Exception\InvalidUuidStringException;
11 const VALID_UUID4 =
'/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/';
13 const UUID4 =
'f47ac10b-58cc-4372-a567-0e02b2c3d479';
32 $this->assertEquals(1, preg_match(self::VALID_UUID4, $uuid->toString()));
43 $this->assertTrue(is_string($uuid));
44 $this->assertEquals(1, preg_match(self::VALID_UUID4, $uuid));
53 $uuid =
$factory->fromString(self::UUID4);
55 $this->assertEquals(1, preg_match(self::VALID_UUID4, $uuid->toString()));
56 $this->assertEquals(self::UUID4, $uuid->toString());
64 $this->expectException(InvalidUuidStringException::class);
An exception for terminatinating execution or to throw for unit testing.
test_from_illegal_string()
@depends test_init
test_uuid4_string()
@depends test_init
test_uuid4()
@depends test_init
test_from_string()
@depends test_init
test_init()
@doesNotPerformAssertions