Skip to content

Commit fcd15fe

Browse files
committed
Fix values being compared
1 parent 51fac7b commit fcd15fe

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/Unit/NothingPersonalValidatorTest.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ public function testFalseForSensibleMatch(): void
162162
* $config->maxSimilarity = 50; is the highest setting where all tests pass.
163163
*/
164164
#[DataProvider('provideIsNotPersonalFalsePositivesCaughtByIsNotSimilar')]
165-
public function testIsNotPersonalFalsePositivesCaughtByIsNotSimilar(mixed $password): void
165+
public function testIsNotPersonalFalsePositivesCaughtByIsNotSimilar(string $password): void
166166
{
167-
new User([
167+
$user = new User([
168168
'username' => 'CaptainJoe',
169169
'email' => 'JosephSmith@example.com',
170170
]);
@@ -173,16 +173,19 @@ public function testIsNotPersonalFalsePositivesCaughtByIsNotSimilar(mixed $passw
173173
$config->maxSimilarity = 50;
174174
$this->validator = new NothingPersonalValidator($config);
175175

176-
$isNotPersonal = $this->getPrivateMethodInvoker($this->validator, 'isNotPersonal');
176+
$isNotPersonal = self::getPrivateMethodInvoker($this->validator, 'isNotPersonal');
177177

178-
$isNotSimilar = $this->getPrivateMethodInvoker($this->validator, 'isNotSimilar');
178+
$isNotSimilar = self::getPrivateMethodInvoker($this->validator, 'isNotSimilar');
179179

180-
$this->assertNotSame($isNotPersonal, $isNotSimilar);
180+
$this->assertNotSame($isNotPersonal($password, $user), $isNotSimilar($password, $user));
181181
}
182182

183+
/**
184+
* @return iterable<int, array{0: string}>
185+
*/
183186
public static function provideIsNotPersonalFalsePositivesCaughtByIsNotSimilar(): iterable
184187
{
185-
return [
188+
yield from [
186189
['JoeTheCaptain'],
187190
['JoeCaptain'],
188191
['CaptainJ'],

0 commit comments

Comments
 (0)