LDAP authentication support (#815)
This commit is contained in:
34
tests/Security/RoleServiceTest.php
Normal file
34
tests/Security/RoleServiceTest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Security;
|
||||
|
||||
use App\Security\RoleService;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Security\RoleService
|
||||
*/
|
||||
class RoleServiceTest extends TestCase
|
||||
{
|
||||
public function testGetAvailableNames()
|
||||
{
|
||||
$real = [
|
||||
'ROLE_TEAMLEAD' => [0 => 'ROLE_USER'],
|
||||
'ROLE_ADMIN' => [0 => 'ROLE_TEAMLEAD'],
|
||||
'ROLE_SUPER_ADMIN' => [0 => 'ROLE_ADMIN']
|
||||
];
|
||||
|
||||
$sut = new RoleService($real);
|
||||
|
||||
$expected = ['ROLE_TEAMLEAD', 'ROLE_USER', 'ROLE_ADMIN', 'ROLE_SUPER_ADMIN'];
|
||||
|
||||
self::assertEquals($expected, $sut->getAvailableNames());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user