@@ -66,16 +66,16 @@ public function testCostInRange()
66
66
public function testResultLength ()
67
67
{
68
68
$ encoder = new BCryptPasswordEncoder ($ this ->secureRandom , self ::VALID_COST );
69
- $ result = $ encoder ->encodePassword (self ::PASSWORD );
69
+ $ result = $ encoder ->encodePassword (self ::PASSWORD , null );
70
70
$ this ->assertEquals (60 , strlen ($ result ));
71
71
}
72
72
73
73
public function testValidation ()
74
74
{
75
75
$ encoder = new BCryptPasswordEncoder ($ this ->secureRandom , self ::VALID_COST );
76
- $ result = $ encoder ->encodePassword (self ::PASSWORD );
77
- $ this ->assertTrue ($ encoder ->isPasswordValid ($ result , self ::PASSWORD ));
78
- $ this ->assertFalse ($ encoder ->isPasswordValid ($ result , 'anotherPassword ' ));
76
+ $ result = $ encoder ->encodePassword (self ::PASSWORD , null );
77
+ $ this ->assertTrue ($ encoder ->isPasswordValid ($ result , self ::PASSWORD , null ));
78
+ $ this ->assertFalse ($ encoder ->isPasswordValid ($ result , 'anotherPassword ' , null ));
79
79
}
80
80
81
81
public function testValidationKnownPassword ()
@@ -85,7 +85,7 @@ public function testValidationKnownPassword()
85
85
? '2y ' : '2a ' ).'$ ' ;
86
86
87
87
$ encrypted = $ prefix .'04$ABCDEFGHIJKLMNOPQRSTU.uTmwd4KMSHxbUsG7bng8x7YdA0PM1iq ' ;
88
- $ this ->assertTrue ($ encoder ->isPasswordValid ($ encrypted , self ::PASSWORD ));
88
+ $ this ->assertTrue ($ encoder ->isPasswordValid ($ encrypted , self ::PASSWORD , null ));
89
89
}
90
90
91
91
public function testSecureRandomIsUsed ()
@@ -100,7 +100,7 @@ public function testSecureRandomIsUsed()
100
100
;
101
101
102
102
$ encoder = new BCryptPasswordEncoder ($ this ->secureRandom , self ::VALID_COST );
103
- $ result = $ encoder ->encodePassword (self ::PASSWORD );
103
+ $ result = $ encoder ->encodePassword (self ::PASSWORD , null );
104
104
105
105
$ prefix = '$ ' .(version_compare (phpversion (), '5.3.7 ' , '>= ' )
106
106
? '2y ' : '2a ' ).'$ ' ;
0 commit comments