Passed
Push — master ( cdbf03...0df18a )
by Aimeos
04:18
created

UserTest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetId() 0 3 1
A testGetSalt() 0 3 1
A setUp() 0 3 1
A testEraseCredentials() 0 4 1
A testGetPassword() 0 3 1
A testGetRoles() 0 3 1
A testGetUserIdentifier() 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 testGetSalt()
39
	{
40
		$this->assertEquals( 'mshop', $this->object->getSalt() );
41
	}
42
43
44
	public function testGetRoles()
45
	{
46
		$this->assertEquals( array( 'ROLE_USER' ), $this->object->getRoles() );
47
	}
48
49
50
	public function testEraseCredentials()
51
	{
52
		$this->object->eraseCredentials();
53
		$this->assertNull( $this->object->getPassword() );
54
	}
55
}
56