NamedRoleTest.php 1.09 KB
Newer Older
1
2
3
<?php
namespace UnicaenAuthTest\Acl;

4
use PHPUnit\Framework\TestCase;
5
6
7
8
9
10
11
use UnicaenAuth\Acl\NamedRole;

/**
 * Description of NamedRoleTest
 *
 * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
 */
12
class NamedRoleTest extends TestCase
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
    public function testCanConstructWithoutName()
    {
        $role = new NamedRole('role-id', null);
        $this->assertEquals($role->getRoleId(), $role->getRoleName());
    }
    
    public function testCanConstructWithName()
    {
        $role = new NamedRole('role-id', null, $name = "Role name");
        $this->assertEquals($name, $role->getRoleName());
    }
    
    public function testCanSetName()
    {
        $role = new NamedRole('role-id', null, "Role name");
        $role->setRoleName($name = "New role name");
        $this->assertEquals($name, $role->getRoleName());
    }
32
33
34
35
36
37
38
    
    public function testCanSetDescription()
    {
        $role = new NamedRole('role-id', null, null, "Role description");
        $role->setRoleDescription($desc = "New role description");
        $this->assertEquals($desc, $role->getRoleDescription());
    }
39
}