Skip to content

Commit c82ef36

Browse files
committed
test: add test to save new user and get email identity
1 parent 2ce8b3d commit c82ef36

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/Unit/UserModelTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,21 @@ public function testInsertUserObject(): void
6262
]);
6363
}
6464

65+
/**
66+
* @see https://github.com/codeigniter4/shield/issues/450
67+
*/
68+
public function testSaveNewUserAndGetEmailIdentity(): void
69+
{
70+
$users = $this->createUserModel();
71+
$user = $this->createNewUser();
72+
73+
$users->save($user);
74+
75+
$identity = $user->getEmailIdentity();
76+
77+
$this->assertSame('foo@bar.com', $identity->secret);
78+
}
79+
6580
/**
6681
* This test is not correct.
6782
*

0 commit comments

Comments
 (0)