Skip to content

Commit

Permalink
Add base64 output test to InitialsAvatarTest
Browse files Browse the repository at this point in the history
This commit introduces a new test case to the `InitialsAvatarTest` suite. This new test verifies that the `generate()` function, with 'base64' as an argument, provides the expected Base64 output.
  • Loading branch information
renfordt committed Apr 3, 2024
1 parent 4f7bf8c commit 9404b33
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/InitialsAvatarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,16 @@ public function testSetSize(): void
$initialsAvatar->generate()
);
}

public function testGenerateWithBase64(): void
{
$initialsAvatar = new InitialsAvatar('Test Name');
$svg = $initialsAvatar->generate();
$base64 = $initialsAvatar->generate([], 'base64');

$this->assertEquals(
'data:image/svg+xml;base64,'.base64_encode($svg),
$base64
);
}
}

0 comments on commit 9404b33

Please sign in to comment.