mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-20 11:33:59 +00:00
Improve some test coverage.
This commit is contained in:
@@ -128,6 +128,18 @@ class UserRepository implements UserRepositoryInterface
|
||||
return $this->all()->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param string $displayName
|
||||
* @param string $description
|
||||
*
|
||||
* @return Role
|
||||
*/
|
||||
public function createRole(string $name, string $displayName, string $description): Role
|
||||
{
|
||||
return Role::create(['name' => $name, 'display_name' => $displayName, 'description' => $description]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
@@ -178,6 +190,16 @@ class UserRepository implements UserRepositoryInterface
|
||||
return User::first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $role
|
||||
*
|
||||
* @return Role|null
|
||||
*/
|
||||
public function getRole(string $role): ?Role
|
||||
{
|
||||
return Role::where('name', $role)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return basic user information.
|
||||
*
|
||||
|
Reference in New Issue
Block a user