Improve some test coverage.

This commit is contained in:
James Cole
2018-01-21 18:06:57 +01:00
parent d5e6d1c578
commit 48fa86cc54
5 changed files with 189 additions and 7 deletions

View File

@@ -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.
*