@@ -84,7 +84,10 @@ public function testCreateWithHasher(): void
8484 $ requestStackMock = $ this ->getRequestStackMock (true );
8585
8686 $ hasher = $ this ->createMock (UserPasswordHasherInterface::class);
87- $ hasher ->method ('hashPassword ' )->with ($ user , $ password )->willReturn ('hashed_password ' );
87+ $ hasher ->expects (self ::once ())->method ('hashPassword ' )
88+ ->with ($ user , $ password )
89+ ->willReturn ('hashed_password ' )
90+ ;
8891
8992 $ manipulator = new SimpleUserManipulator ($ userManagerMock , $ eventDispatcherMock , $ requestStackMock , $ hasher );
9093 $ manipulator ->create ($ username , $ password , $ email , true , false );
@@ -383,7 +386,10 @@ public function testChangePasswordWithValidUsernameAndHasher(): void
383386 $ requestStackMock = $ this ->getRequestStackMock (true );
384387
385388 $ hasher = $ this ->createMock (UserPasswordHasherInterface::class);
386- $ hasher ->method ('hashPassword ' )->with ($ user , $ password )->willReturn ('hashed_password ' );
389+ $ hasher ->expects (self ::once ())->method ('hashPassword ' )
390+ ->with ($ user , $ password )
391+ ->willReturn ('hashed_password ' )
392+ ;
387393
388394 $ manipulator = new SimpleUserManipulator ($ userManagerMock , $ eventDispatcherMock , $ requestStackMock , $ hasher );
389395 $ manipulator ->changePassword ($ username , $ password );
0 commit comments