Skip to content

Commit f7303fb

Browse files
committed
Override the default hashing cost in BcryptTest
1 parent 938bdab commit f7303fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/Methods/BcryptTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ public function it_can_be_hashed_with_bcrypt(): void
1515
{
1616
$string = new Twine\Str('john pinkerton');
1717

18-
$bcrypt = $string->bcrypt();
18+
$bcrypt = $string->bcrypt(['cost' => 12]);
1919

2020
$this->assertInstanceOf(Twine\Str::class, $bcrypt);
21-
$this->assertMatchesRegularExpression('/\$2y\$10\$[a-zA-Z0-9+.\/]{53}/', (string) $bcrypt);
21+
$this->assertMatchesRegularExpression('/\$2y\$12\$[a-zA-Z0-9+.\/]{53}/', (string) $bcrypt);
2222
}
2323

2424
#[Test]
2525
public function a_multibyte_string_can_be_hashed_with_bcrypt(): void
2626
{
2727
$string = new Twine\Str('宮本 茂');
2828

29-
$bcrypt = $string->bcrypt();
29+
$bcrypt = $string->bcrypt(['cost' => 12]);
3030

3131
$this->assertInstanceOf(Twine\Str::class, $bcrypt);
32-
$this->assertMatchesRegularExpression('/\$2y\$10\$[a-zA-Z0-9+.\/]{53}/', (string) $bcrypt);
32+
$this->assertMatchesRegularExpression('/\$2y\$12\$[a-zA-Z0-9+.\/]{53}/', (string) $bcrypt);
3333
}
3434

3535
#[Test]

0 commit comments

Comments
 (0)