UserTest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 9
c 1
b 0
f 0
dl 0
loc 39
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetId() 0 3 1
A setUp() 0 3 1
A testGetPassword() 0 3 1
A testGetUserIdentifier() 0 3 1
A testEraseCredentials() 0 4 1
A testGetRoles() 0 3 1
1
<?php
2
3
namespace Aimeos\ShopBundle\Tests\Entity;
4
5
6
use Aimeos\ShopBundle\Entity\User;
7
8
9
class UserTest extends \PHPUnit\Framework\TestCase
10
{
11
	private $object;
12
13
14
	protected function setUp() : void
15
	{
16
		$this->object = new User();
17
	}
18
19
20
	public function testGetId()
21
	{
22
		$this->assertEquals( null, $this->object->getId() );
23
	}
24
25
26
	public function testGetUserIdentifier()
27
	{
28
		$this->assertEquals( null, $this->object->getUserIdentifier() );
29
	}
30
31
32
	public function testGetPassword()
33
	{
34
		$this->assertEquals( null, $this->object->getPassword() );
35
	}
36
37
38
	public function testGetRoles()
39
	{
40
		$this->assertEquals( array( 'ROLE_USER' ), $this->object->getRoles() );
41
	}
42
43
44
	public function testEraseCredentials()
45
	{
46
		$this->object->eraseCredentials();
47
		$this->assertNull( $this->object->getPassword() );
48
	}
49
}
50