-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUserTest.php
More file actions
38 lines (28 loc) · 806 Bytes
/
UserTest.php
File metadata and controls
38 lines (28 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Tests\Utopia\Agents\Roles;
use PHPUnit\Framework\TestCase;
use Utopia\Agents\Role;
use Utopia\Agents\Roles\User;
class UserTest extends TestCase
{
public function testConstructor(): void
{
$id = 'test-id';
$name = 'Test User';
$user = new User($id, $name);
$this->assertSame($id, $user->getId());
$this->assertSame($name, $user->getName());
}
public function testConstructorWithoutName(): void
{
$id = 'test-id';
$user = new User($id);
$this->assertSame($id, $user->getId());
$this->assertSame('', $user->getName());
}
public function testGetIdentifier(): void
{
$user = new User('test-id');
$this->assertSame(Role::ROLE_USER, $user->getIdentifier());
}
}