Skip to content

Commit f4daf26

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

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

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('[email protected]', $identity->secret);
232232
}
233+
234+
public function testSaveEmailIdentity(): void
235+
{
236+
$hash = service('passwords')->hash('passbar');
237+
$this->user->email = '[email protected]';
238+
$this->user->password_hash = $hash;
239+
240+
$this->user->saveEmailIdentity();
241+
242+
$identity = $this->user->getEmailIdentity();
243+
$this->assertSame('[email protected]', $identity->secret);
244+
}
233245
}

0 commit comments

Comments
 (0)