diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/units/Helper/UserHelperTest.php | 1 | ||||
-rw-r--r-- | tests/units/User/Avatar/LetterAvatarProviderTest.php | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/units/Helper/UserHelperTest.php b/tests/units/Helper/UserHelperTest.php index c149e663..10bbc58e 100644 --- a/tests/units/Helper/UserHelperTest.php +++ b/tests/units/Helper/UserHelperTest.php @@ -20,6 +20,7 @@ class UserHelperTest extends Base $this->assertEquals('CN', $helper->getInitials('chuck norris')); $this->assertEquals('CN', $helper->getInitials('chuck norris #2')); $this->assertEquals('A', $helper->getInitials('admin')); + $this->assertEquals('Ü君', $helper->getInitials('Ü 君が代')); } public function testGetRoleName() diff --git a/tests/units/User/Avatar/LetterAvatarProviderTest.php b/tests/units/User/Avatar/LetterAvatarProviderTest.php index 39e51c98..0eb3ef8e 100644 --- a/tests/units/User/Avatar/LetterAvatarProviderTest.php +++ b/tests/units/User/Avatar/LetterAvatarProviderTest.php @@ -34,4 +34,12 @@ class LetterAvatarProviderTest extends Base $expected = '<div class="avatar-letter" style="background-color: rgb(134, 45, 132)" title="admin">A</div>'; $this->assertEquals($expected, $provider->render($user, 48)); } + + public function testRenderWithUTF8() + { + $provider = new LetterAvatarProvider($this->container); + $user = array('id' => 123, 'name' => 'ü', 'username' => 'admin', 'email' => ''); + $expected = '<div class="avatar-letter" style="background-color: rgb(62, 147, 31)" title="ü">Ü</div>'; + $this->assertEquals($expected, $provider->render($user, 48)); + } } |