Add test covering Uuid::fromString() being called with empty string

This commit is contained in:
Chris Smith
2021-08-09 12:55:31 +01:00
parent 8fa223b1af
commit ef1eb74c82
+8
View File
@@ -124,6 +124,14 @@ class UuidTest extends TestCase
$this->assertSame('ff6f8cb0-c57d-11e1-9b21-0800200c9a66', $uuid->toString());
}
public function testFromStringWithEmptyString(): void
{
$this->expectException(InvalidUuidStringException::class);
$this->expectExceptionMessage('Invalid UUID string: ');
Uuid::fromString('');
}
public function testGetBytes(): void
{
$uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');