public function test_can_check_if_has_a_role() { $role = new UsherRole(); // Mock id $refObject = new \ReflectionObject($role); $refProperty = $refObject->getProperty('id'); $refProperty->setAccessible(true); $refProperty->setValue($role, 1); $role->setName('Admin'); $this->entity->assignRole($role); $this->assertTrue($this->entity->hasRole(1)); $this->assertFalse($this->entity->hasRole(2)); }