Skip to content

Commit 482ae5e

Browse files
committed
LoginListener: Fix test
1 parent 22d1ce4 commit 482ae5e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

tests/EventListener/LoginListenerTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public function testOnSecurityInteractiveLogin(User $user, bool $createMailCrypt
6767
*/
6868
public function testOnSecurityInteractiveLoginMailCrypt(User $user, bool $createMailCrypt): void
6969
{
70-
$user = new User();
7170
$this->manager->expects($this->once())->method('flush');
7271

7372
if ($createMailCrypt) {
@@ -111,8 +110,6 @@ private function getInteractiveEvent(User $user): InteractiveLoginEvent
111110
*/
112111
public function testOnAuthenticationHandlerSuccess(User $user, bool $createMailCrypt): void
113112
{
114-
$user = new User();
115-
116113
$this->manager->expects($this->once())->method('flush');
117114
$this->mailCryptKeyHandler->expects($this->never())->method('create');
118115

@@ -126,14 +123,12 @@ public function testOnAuthenticationHandlerSuccess(User $user, bool $createMailC
126123
*/
127124
public function testOnAuthenticationHandlerSuccessMailCrypt(User $user, bool $createMailCrypt): void
128125
{
129-
$user = new User();
130-
131126
$this->manager->expects($this->once())->method('flush');
132127

133128
if ($createMailCrypt) {
134129
$this->mailCryptKeyHandler->expects($this->once())->method('create');
135130
} else {
136-
$this->mailCryptKeyHandler->expects($this->once())->method('create');
131+
$this->mailCryptKeyHandler->expects($this->never())->method('create');
137132
}
138133

139134
$event = $this->getLoginEvent($user);

0 commit comments

Comments
 (0)