File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use LasseRafn \InitialAvatarGenerator \InitialAvatar ;
4+ use PHPUnit \Framework \TestCase ;
5+
6+ class AutoColorUtilsTest extends TestCase
7+ {
8+ /** @test */
9+ public function can_create_all_colors ()
10+ {
11+ $ avatar = new InitialAvatar ();
12+
13+ $ avatar ->name ('A ' )->autoColor ();
14+ $ this ->assertEquals ('#f0a742 ' , $ avatar ->getBackgroundColor ());
15+ $ this ->assertEquals ('#000000 ' , $ avatar ->getColor ());
16+
17+ $ avatar ->name ('B ' )->autoColor ();
18+ $ this ->assertEquals ('#42caf0 ' , $ avatar ->getBackgroundColor ());
19+ $ this ->assertEquals ('#000000 ' , $ avatar ->getColor ());
20+
21+ $ avatar ->name ('C ' )->autoColor ();
22+ $ this ->assertEquals ('#42f085 ' , $ avatar ->getBackgroundColor ());
23+ $ this ->assertEquals ('#000000 ' , $ avatar ->getColor ());
24+
25+ $ avatar ->name ('D ' )->autoColor ();
26+ $ this ->assertEquals ('#f04293 ' , $ avatar ->getBackgroundColor ());
27+ $ this ->assertEquals ('#ffffff ' , $ avatar ->getColor ());
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments