Skip to content

Commit 0818741

Browse files
committed
Add some test for more autoColors
1 parent 0239158 commit 0818741

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/AutoColorUtilsTest.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
}

0 commit comments

Comments
 (0)