Skip to content

Commit

Permalink
Update SVG color scheme in avatar tests
Browse files Browse the repository at this point in the history
The color values in the SVG output of the Larvatar and InitialsAvatar classes have been modified in the test scripts. These changes reflect the updated color scheme for avatar generation - from a previous pink (#e8d2dc) to a lighter version (#f3dde7), and from a dark red (#690230) to a brighter purple (#9c3563).
  • Loading branch information
renfordt committed Apr 1, 2024
1 parent 58d74b8 commit 144f936
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: #e8d2dc" /><text x="50%" y="55%" style="fill: #690230; 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: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; 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: #e8d2dc" /><text x="50%" y="55%" style="fill: #690230; 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: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; 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: #e8d2dc" /><text x="50%" y="55%" style="fill: #690230; 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: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; 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: #e8d2dc" /><text x="50%" y="55%" style="fill: #690230; 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: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; 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: #e8d2dc" /><text x="50%" y="55%" style="fill: #690230; 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: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; 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: #e8d2dc" /><text x="50%" y="55%" style="fill: #690230; 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: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; 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: #e8d2dc" /><text x="50%" y="55%" style="fill: #690230; 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: #f3dde7" /><text x="50%" y="55%" style="fill: #9c3563; text-anchor: middle; dominant-baseline: middle; font-family: Roboto; font-size: 50px">TN</text></svg>',
$larvatar->getImageHTML()
);
}
Expand Down

0 comments on commit 144f936

Please sign in to comment.