Check role on user object.
object $account: The user account to check.
string $rid: The role ID to search for.
bool $is_assigned: (optional) Whether to assert that $rid exists (TRUE) or not (FALSE). Defaults to TRUE.
private function userLoadAndCheckRoleAssigned($account, $rid, $is_assigned = TRUE) {
  $account = user_load($account->uid, TRUE);
  if ($is_assigned) {
    $this
      ->assertTrue(array_search($rid, $account->roles), 'The role is present in the user object.');
  }
  else {
    $this
      ->assertFalse(array_search($rid, $account->roles), 'The role is not present in the user object.');
  }
}