Skip to content

Commit f4daf26

Browse files
committed
test: add test for saveEmailIdentity()
1 parent f94cd2d commit f4daf26

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Unit/UserTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,16 @@ public function testCreateEmailIdentity(): void
230230
$identity = $this->user->getEmailIdentity();
231231
$this->assertSame('foo@example.com', $identity->secret);
232232
}
233+
234+
public function testSaveEmailIdentity(): void
235+
{
236+
$hash = service('passwords')->hash('passbar');
237+
$this->user->email = 'foo@example.com';
238+
$this->user->password_hash = $hash;
239+
240+
$this->user->saveEmailIdentity();
241+
242+
$identity = $this->user->getEmailIdentity();
243+
$this->assertSame('foo@example.com', $identity->secret);
244+
}
233245
}

0 commit comments

Comments
 (0)