Skip to content

Commit

Permalink
Add test covering Uuid::fromString() being called with empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
cs278 committed Aug 9, 2021
1 parent 8fa223b commit ef1eb74
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/UuidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ public function testFromStringWithUrn(): void
$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');
Expand Down

0 comments on commit ef1eb74

Please sign in to comment.