Add suggest menu for task ID
This commit is contained in:
42
tests/units/Formatter/UserMentionFormatterTest.php
Normal file
42
tests/units/Formatter/UserMentionFormatterTest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Kanboard\Formatter\UserMentionFormatter;
|
||||
|
||||
require_once __DIR__.'/../Base.php';
|
||||
|
||||
class UserMentionFormatterTest extends Base
|
||||
{
|
||||
public function testFormat()
|
||||
{
|
||||
$userMentionFormatter = new UserMentionFormatter($this->container);
|
||||
$users = array(
|
||||
array(
|
||||
'id' => 1,
|
||||
'username' => 'someone',
|
||||
'name' => 'Someone',
|
||||
'email' => 'test@localhost',
|
||||
'avatar_path' => 'avatar_image',
|
||||
),
|
||||
array(
|
||||
'id' => 2,
|
||||
'username' => 'somebody',
|
||||
'name' => '',
|
||||
'email' => '',
|
||||
'avatar_path' => '',
|
||||
)
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
array(
|
||||
'value' => 'someone',
|
||||
'html' => '<div class="avatar avatar-20 avatar-inline"><img src="?controller=AvatarFileController&action=image&user_id=1&size=20" alt="Someone" title="Someone"></div> someone <small>Someone</small>',
|
||||
),
|
||||
array(
|
||||
'value' => 'somebody',
|
||||
'html' => '<div class="avatar avatar-20 avatar-inline"><div class="avatar-letter" style="background-color: rgb(191, 210, 121)" title="somebody">S</div></div> somebody',
|
||||
),
|
||||
);
|
||||
|
||||
$this->assertSame($expected, $userMentionFormatter->withUsers($users)->format());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user