Skip to content

Commit

Permalink
Fix MemoryAccountMapper::search() with empty pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Petry committed Feb 13, 2018
1 parent e0fca5b commit 7b115df
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/lib/Util/User/MemoryAccountMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public function getUserCount($hasLoggedIn) {
}

public function search($fieldName, $pattern, $limit, $offset) {
if ($pattern === '') {
return self::$accounts;
}
$match = array_filter(self::$accounts, function (Account $a) use ($pattern) {
return stripos($a->getUserId(), $pattern);
});
Expand Down

0 comments on commit 7b115df

Please sign in to comment.