src/Kunstmaan/AdminBundle/Tests/unit/Entity/UserTest.php 1 location
|
@@ 81-88 (lines=8) @@
|
78 |
|
$this->assertEquals($collection, $this->object->getGroups()); |
79 |
|
} |
80 |
|
|
81 |
|
public function testHasRole() |
82 |
|
{ |
83 |
|
$this->object->addRole('ROLE_CUSTOM'); |
84 |
|
$this->assertTrue($this->object->hasRole('ROLE_CUSTOM')); |
85 |
|
|
86 |
|
$this->object->removeRole('ROLE_CUSTOM'); |
87 |
|
$this->assertFalse($this->object->hasRole('ROLE_CUSTOM')); |
88 |
|
} |
89 |
|
|
90 |
|
public function testGettersAndSetters() |
91 |
|
{ |
src/Kunstmaan/AdminBundle/Tests/unit/Entity/GroupTest.php 1 location
|
@@ 83-92 (lines=10) @@
|
80 |
|
$this->assertFalse($this->object->hasRole('role2')); |
81 |
|
} |
82 |
|
|
83 |
|
public function testRemoveRole() |
84 |
|
{ |
85 |
|
/* @var $role Role */ |
86 |
|
$role = $this->getRole(); |
87 |
|
$this->object->addRole($role); |
88 |
|
$this->assertTrue($this->object->hasRole('role1')); |
89 |
|
|
90 |
|
$this->object->removeRole('role1'); |
91 |
|
$this->assertFalse($this->object->hasRole('role1')); |
92 |
|
} |
93 |
|
|
94 |
|
/** |
95 |
|
* @expectedException \InvalidArgumentException |