File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/Symfony/Component/Form/Tests/Extension/PasswordHasher/Type Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 17
17
use Symfony \Component \Form \Extension \PasswordHasher \PasswordHasherExtension ;
18
18
use Symfony \Component \Form \Test \TypeTestCase ;
19
19
use Symfony \Component \Form \Tests \Fixtures \User ;
20
+ use Symfony \Component \PasswordHasher \Hasher \UserPasswordHasher ;
20
21
use Symfony \Component \PasswordHasher \Hasher \UserPasswordHasherInterface ;
21
22
use Symfony \Component \Security \Core \User \PasswordAuthenticatedUserInterface ;
22
23
@@ -33,7 +34,7 @@ protected function setUp(): void
33
34
$ this ->markTestSkipped ('PasswordAuthenticatedUserInterface not available. ' );
34
35
}
35
36
36
- $ this ->passwordHasher = $ this ->createMock (UserPasswordHasherInterface ::class);
37
+ $ this ->passwordHasher = $ this ->createMock (UserPasswordHasher ::class);
37
38
38
39
parent ::setUp ();
39
40
}
@@ -52,7 +53,8 @@ public function testPasswordHashSuccess()
52
53
$ plainPassword = 'PlainPassword ' ;
53
54
$ hashedPassword = 'HashedPassword ' ;
54
55
55
- $ this ->passwordHasher ->expects ($ this ->once ())
56
+ $ this ->passwordHasher
57
+ ->expects ($ this ->once ())
56
58
->method ('hashPassword ' )
57
59
->with ($ user , $ plainPassword )
58
60
->willReturn ($ hashedPassword )
@@ -79,6 +81,11 @@ public function testPasswordHashOnInvalidForm()
79
81
{
80
82
$ user = new User ();
81
83
84
+ $ this ->passwordHasher
85
+ ->expects ($ this ->never ())
86
+ ->method ('hashPassword ' )
87
+ ;
88
+
82
89
$ this ->assertNull ($ user ->getPassword ());
83
90
84
91
$ form = $ this ->factory
You can’t perform that action at this time.
0 commit comments