Skip to content

Commit f9a3e61

Browse files
committed
fix tests
1 parent 09bbb2d commit f9a3e61

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/AvatarPhpTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public function it_can_generate_circle_svg()
244244
{
245245
$expected = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">';
246246
$expected .= '<circle cx="50" cy="50" r="45" stroke="yellow" stroke-width="10" fill="red" />';
247-
$expected .= '<text x="50" y="50" font-size="24" fill="white" alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text>';
247+
$expected .= '<text font-size="24" fill="white" x="50%" y="50%" dy=".1em" style="line-height:1" alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text>';
248248
$expected .= '</svg>';
249249

250250
$avatar = new \Laravolt\Avatar\Avatar();
@@ -267,7 +267,7 @@ public function it_can_generate_rectangle_svg()
267267
{
268268
$expected = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">';
269269
$expected .= '<rect x="5" y="5" width="90" height="90" stroke="yellow" stroke-width="10" rx="15" fill="red" />';
270-
$expected .= '<text x="50" y="50" font-size="24" fill="white" alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text>';
270+
$expected .= '<text font-size="24" fill="white" x="50%" y="50%" dy=".1em" style="line-height:1" alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text>';
271271
$expected .= '</svg>';
272272

273273
$avatar = new \Laravolt\Avatar\Avatar();
@@ -291,7 +291,7 @@ public function it_can_generate_svg_with_custom_font_family()
291291
{
292292
$expected = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">';
293293
$expected .= '<circle cx="50" cy="50" r="45" stroke="yellow" stroke-width="10" fill="red" />';
294-
$expected .= '<text x="50" y="50" font-size="24" font-family="Lato" fill="white" alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text>';
294+
$expected .= '<text font-size="24" font-family="Lato" fill="white" x="50%" y="50%" dy=".1em" style="line-height:1" alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text>';
295295
$expected .= '</svg>';
296296

297297
$avatar = new \Laravolt\Avatar\Avatar();
@@ -315,7 +315,7 @@ public function it_can_use_the_foreground_color_for_the_svg_border()
315315
{
316316
$expected = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">';
317317
$expected .= '<circle cx="50" cy="50" r="45" stroke="green" stroke-width="10" fill="red" />';
318-
$expected .= '<text x="50" y="50" font-size="24" fill="green" alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text>';
318+
$expected .= '<text font-size="24" fill="green" x="50%" y="50%" dy=".1em" style="line-height:1" alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text>';
319319
$expected .= '</svg>';
320320

321321
$avatar = new \Laravolt\Avatar\Avatar(['border' => ['size' => 10, 'color' => 'foreground']]);
@@ -337,7 +337,7 @@ public function it_can_use_the_background_color_for_the_svg_border()
337337
{
338338
$expected = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">';
339339
$expected .= '<circle cx="50" cy="50" r="45" stroke="red" stroke-width="10" fill="red" />';
340-
$expected .= '<text x="50" y="50" font-size="24" fill="green" alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text>';
340+
$expected .= '<text font-size="24" fill="green" x="50%" y="50%" dy=".1em" style="line-height:1" alignment-baseline="middle" text-anchor="middle" dominant-baseline="central">AB</text>';
341341
$expected .= '</svg>';
342342

343343
$avatar = new \Laravolt\Avatar\Avatar(['border' => ['size' => 10, 'color' => 'background']]);

0 commit comments

Comments
 (0)