@@ -49,7 +49,7 @@ public function testEncodeNoPasswordNoInteraction()
49
49
'command ' => 'security:encode-password ' ,
50
50
], ['interactive ' => false ]);
51
51
52
- $ this ->assertContains ('[ERROR] The password must not be empty. ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
52
+ $ this ->assertStringContainsString ('[ERROR] The password must not be empty. ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
53
53
$ this ->assertEquals ($ statusCode , 1 );
54
54
}
55
55
@@ -62,7 +62,7 @@ public function testEncodePasswordBcrypt()
62
62
], ['interactive ' => false ]);
63
63
64
64
$ output = $ this ->passwordEncoderCommandTester ->getDisplay ();
65
- $ this ->assertContains ('Password encoding succeeded ' , $ output );
65
+ $ this ->assertStringContainsString ('Password encoding succeeded ' , $ output );
66
66
67
67
$ encoder = new BCryptPasswordEncoder (17 );
68
68
preg_match ('# Encoded password\s{1,}([\w+\/$.]+={0,2})\s+# ' , $ output , $ matches );
@@ -83,7 +83,7 @@ public function testEncodePasswordArgon2i()
83
83
], ['interactive ' => false ]);
84
84
85
85
$ output = $ this ->passwordEncoderCommandTester ->getDisplay ();
86
- $ this ->assertContains ('Password encoding succeeded ' , $ output );
86
+ $ this ->assertStringContainsString ('Password encoding succeeded ' , $ output );
87
87
88
88
$ encoder = new Argon2iPasswordEncoder ();
89
89
preg_match ('# Encoded password\s+(\$argon2id?\$[\w,=\$+\/]+={0,2})\s+# ' , $ output , $ matches );
@@ -100,7 +100,7 @@ public function testEncodePasswordPbkdf2()
100
100
], ['interactive ' => false ]);
101
101
102
102
$ output = $ this ->passwordEncoderCommandTester ->getDisplay ();
103
- $ this ->assertContains ('Password encoding succeeded ' , $ output );
103
+ $ this ->assertStringContainsString ('Password encoding succeeded ' , $ output );
104
104
105
105
$ encoder = new Pbkdf2PasswordEncoder ('sha512 ' , true , 1000 );
106
106
preg_match ('# Encoded password\s{1,}([\w+\/]+={0,2})\s+# ' , $ output , $ matches );
@@ -119,9 +119,9 @@ public function testEncodePasswordOutput()
119
119
], ['interactive ' => false ]
120
120
);
121
121
122
- $ this ->assertContains ('Password encoding succeeded ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
123
- $ this ->assertContains (' Encoded password p@ssw0rd ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
124
- $ this ->assertContains (' Generated salt ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
122
+ $ this ->assertStringContainsString ('Password encoding succeeded ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
123
+ $ this ->assertStringContainsString (' Encoded password p@ssw0rd ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
124
+ $ this ->assertStringContainsString (' Generated salt ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
125
125
}
126
126
127
127
public function testEncodePasswordEmptySaltOutput ()
@@ -133,9 +133,9 @@ public function testEncodePasswordEmptySaltOutput()
133
133
'--empty-salt ' => true ,
134
134
]);
135
135
136
- $ this ->assertContains ('Password encoding succeeded ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
137
- $ this ->assertContains (' Encoded password p@ssw0rd ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
138
- $ this ->assertNotContains (' Generated salt ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
136
+ $ this ->assertStringContainsString ('Password encoding succeeded ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
137
+ $ this ->assertStringContainsString (' Encoded password p@ssw0rd ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
138
+ $ this ->assertStringNotContainsString (' Generated salt ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
139
139
}
140
140
141
141
public function testEncodePasswordBcryptOutput ()
@@ -146,7 +146,7 @@ public function testEncodePasswordBcryptOutput()
146
146
'user-class ' => 'Custom\Class\Bcrypt\User ' ,
147
147
], ['interactive ' => false ]);
148
148
149
- $ this ->assertNotContains (' Generated salt ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
149
+ $ this ->assertStringNotContainsString (' Generated salt ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
150
150
}
151
151
152
152
public function testEncodePasswordArgon2iOutput ()
@@ -162,7 +162,7 @@ public function testEncodePasswordArgon2iOutput()
162
162
'user-class ' => 'Custom\Class\Argon2i\User ' ,
163
163
], ['interactive ' => false ]);
164
164
165
- $ this ->assertNotContains (' Generated salt ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
165
+ $ this ->assertStringNotContainsString (' Generated salt ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
166
166
}
167
167
168
168
public function testEncodePasswordNoConfigForGivenUserClass ()
@@ -185,7 +185,7 @@ public function testEncodePasswordAsksNonProvidedUserClass()
185
185
'password ' => 'password ' ,
186
186
], ['decorated ' => false ]);
187
187
188
- $ this ->assertContains (<<<EOTXT
188
+ $ this ->assertStringContainsString (<<<EOTXT
189
189
For which user class would you like to encode a password? [Custom\Class\Bcrypt\User]:
190
190
[0] Custom\Class\Bcrypt\User
191
191
[1] Custom\Class\Pbkdf2\User
@@ -202,7 +202,7 @@ public function testNonInteractiveEncodePasswordUsesFirstUserClass()
202
202
'password ' => 'password ' ,
203
203
], ['interactive ' => false ]);
204
204
205
- $ this ->assertContains ('Encoder used Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
205
+ $ this ->assertStringContainsString ('Encoder used Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder ' , $ this ->passwordEncoderCommandTester ->getDisplay ());
206
206
}
207
207
208
208
public function testThrowsExceptionOnNoConfiguredEncoders ()
@@ -240,7 +240,7 @@ public function testLegacy()
240
240
'password ' => 'password ' ,
241
241
], ['interactive ' => false ]);
242
242
243
- $ this ->assertContains ('Encoder used Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder ' , $ tester ->getDisplay ());
243
+ $ this ->assertStringContainsString ('Encoder used Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder ' , $ tester ->getDisplay ());
244
244
}
245
245
246
246
protected function setUp ()
0 commit comments