Skip to content

Commit 0932fa9

Browse files
committed
Forgot to stage this file (annoyed grunt)
1 parent 3e42bc9 commit 0932fa9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

app/sprinkles/account/tests/withTestUser.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ protected function createTestUser($isMaster = false, $login = false, array $para
5858
$user_id = $this->getRandomUserId($this->ci->config['reserved_user_ids.master']);
5959
}
6060

61-
$params = array_merge(['id' => $user_id], $params);
61+
// If user exist, returns it, otherwise create a new one
62+
if (!$user = User::find($user_id)) {
63+
$params = array_merge(['id' => $user_id], $params);
6264

63-
$fm = $this->ci->factory;
64-
$user = $fm->create(User::class, $params);
65+
$fm = $this->ci->factory;
66+
$user = $fm->create(User::class, $params);
67+
}
6568

6669
if ($login) {
6770
$this->loginUser($user);

0 commit comments

Comments
 (0)