Skip to content

Commit

Permalink
Update SVG color in avatar tests
Browse files Browse the repository at this point in the history
The test assertions for avatar generation have been updated to reflect a recent change in the color scheme used for the SVG output. The changes involve updating both the fill and text colors in the SVG strings expected by the tests.
  • Loading branch information
renfordt committed Apr 5, 2024
1 parent 37aa966 commit 1cb7240
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tests/InitialsAvatarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function testCreateLarvatarByConstructor(): void
{
$initialsAvatar = new InitialsAvatar('Test Name');
$this->assertEquals(
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><circle cx="64" cy="64" r="64" style="fill: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; text-anchor: middle; dominant-baseline: middle; font-size: 64px">TN</text></svg>',
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><circle cx="64" cy="64" r="64" style="fill: #e5b3ca" /><text x="50%" y="55%" style="fill: #852e55; text-anchor: middle; dominant-baseline: middle; font-size: 64px">TN</text></svg>',
$initialsAvatar->generate()
);
}
Expand All @@ -30,7 +30,7 @@ public function testCreateLarvatarByMethod(): void
$initialsAvatar = new InitialsAvatar();
$initialsAvatar->setName('Test Name');
$this->assertEquals(
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><circle cx="64" cy="64" r="64" style="fill: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; text-anchor: middle; dominant-baseline: middle; font-size: 64px">TN</text></svg>',
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><circle cx="64" cy="64" r="64" style="fill: #e5b3ca" /><text x="50%" y="55%" style="fill: #852e55; text-anchor: middle; dominant-baseline: middle; font-size: 64px">TN</text></svg>',
$initialsAvatar->generate()
);
}
Expand All @@ -42,7 +42,7 @@ public function testSetFont(): void
$initialsAvatar->setFont('Roboto', '/../src/font/Roboto-Bold.ttf');

$this->assertEquals(
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><circle cx="64" cy="64" r="64" style="fill: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; text-anchor: middle; dominant-baseline: middle; font-family: Roboto; font-size: 64px">TN</text></svg>',
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><circle cx="64" cy="64" r="64" style="fill: #e5b3ca" /><text x="50%" y="55%" style="fill: #852e55; text-anchor: middle; dominant-baseline: middle; font-family: Roboto; font-size: 64px">TN</text></svg>',
$initialsAvatar->generate()
);
}
Expand All @@ -52,7 +52,7 @@ public function testSetSize(): void
$initialsAvatar = new InitialsAvatar('Test Name');
$initialsAvatar->setSize(500);
$this->assertEquals(
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="500" height="500"><circle cx="250" cy="250" r="250" style="fill: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; text-anchor: middle; dominant-baseline: middle; font-size: 250px">TN</text></svg>',
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="500" height="500"><circle cx="250" cy="250" r="250" style="fill: #e5b3ca" /><text x="50%" y="55%" style="fill: #852e55; text-anchor: middle; dominant-baseline: middle; font-size: 250px">TN</text></svg>',
$initialsAvatar->generate()
);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/LarvatarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public function testCreateLarvatar(): void
{
$larvatar = new Larvatar('Test Name', 'test@example.com', LarvatarTypes::InitialsAvatar);
$this->assertEquals(
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100"><circle cx="50" cy="50" r="50" style="fill: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; text-anchor: middle; dominant-baseline: middle; font-size: 50px">TN</text></svg>',
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100"><circle cx="50" cy="50" r="50" style="fill: #e5b3ca" /><text x="50%" y="55%" style="fill: #852e55; text-anchor: middle; dominant-baseline: middle; font-size: 50px">TN</text></svg>',
$larvatar->getImageHTML()
);
}
Expand All @@ -19,7 +19,7 @@ public function testCreateLarvatarWithInt(): void
{
$larvatar = new Larvatar('Test Name', 'test@example.com', 0);
$this->assertEquals(
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100"><circle cx="50" cy="50" r="50" style="fill: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; text-anchor: middle; dominant-baseline: middle; font-size: 50px">TN</text></svg>',
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100"><circle cx="50" cy="50" r="50" style="fill: #e5b3ca" /><text x="50%" y="55%" style="fill: #852e55; text-anchor: middle; dominant-baseline: middle; font-size: 50px">TN</text></svg>',
$larvatar->getImageHTML()
);
}
Expand All @@ -40,7 +40,7 @@ public function testSetFont(): void
$larvatar = new Larvatar('Test Name', 'test@example.com', LarvatarTypes::InitialsAvatar);
$larvatar->setFont('Roboto', '/../src/font/Roboto-Bold.ttf');
$this->assertEquals(
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100"><circle cx="50" cy="50" r="50" style="fill: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; text-anchor: middle; dominant-baseline: middle; font-family: Roboto; font-size: 50px">TN</text></svg>',
'<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100"><circle cx="50" cy="50" r="50" style="fill: #e5b3ca" /><text x="50%" y="55%" style="fill: #852e55; text-anchor: middle; dominant-baseline: middle; font-family: Roboto; font-size: 50px">TN</text></svg>',
$larvatar->getImageHTML()
);
}
Expand Down

0 comments on commit 1cb7240

Please # to comment.