Skip to content

Commit

Permalink
Updated tests to use assertMatchesRegularExpression()
Browse files Browse the repository at this point in the history
  • Loading branch information
PHLAK committed Jul 14, 2020
1 parent f830b16 commit 8e7ce66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/Methods/BcryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function test_it_can_be_hashed_with_bcrypt()
$bcrypt = $string->bcrypt();

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

public function test_a_multibyte_string_can_be_hashed_with_bcrypt()
Expand All @@ -24,7 +24,7 @@ public function test_a_multibyte_string_can_be_hashed_with_bcrypt()
$bcrypt = $string->bcrypt();

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

public function test_it_preserves_encoding()
Expand Down
4 changes: 2 additions & 2 deletions tests/Methods/EncryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function test_it_can_be_encrypted()
$encrypted = $string->encrypt('secret');

$this->assertInstanceOf(Twine\Str::class, $encrypted);
$this->assertRegExp('/[a-zA-Z0-9=+\/]+/', (string) $encrypted);
$this->assertMatchesRegularExpression('/[a-zA-Z0-9=+\/]+/', (string) $encrypted);

return $encrypted;
}
Expand All @@ -36,7 +36,7 @@ public function test_a_multibyte_string_can_be_encrypted()
$encrypted = $string->encrypt('secret');

$this->assertInstanceOf(Twine\Str::class, $encrypted);
$this->assertRegExp('/[a-zA-Z0-9=+\/]+/', (string) $encrypted);
$this->assertMatchesRegularExpression('/[a-zA-Z0-9=+\/]+/', (string) $encrypted);

return $encrypted;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Methods/ShuffleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function test_it_can_be_shuffled()

$this->assertInstanceOf(Twine\Str::class, $shuffled);
$this->assertNotEquals($string, $shuffled);
$this->assertRegExp('/[ ehijknoprt]{14}/', (string) $shuffled);
$this->assertMatchesRegularExpression('/[ ehijknoprt]{14}/', (string) $shuffled);
}

public function test_a_multibyte_string_can_be_shuffled()
Expand All @@ -34,7 +34,7 @@ public function test_a_multibyte_string_can_be_shuffled()

$this->assertInstanceOf(Twine\Str::class, $shuffled);
$this->assertNotEquals($string, $shuffled);
$this->assertRegExp('/[ 本天任宮堂茂]{7}/', (string) $shuffled);
$this->assertMatchesRegularExpression('/[ 本天任宮堂茂]{7}/', (string) $shuffled);
}

public function test_it_preserves_encoding()
Expand Down

0 comments on commit 8e7ce66

Please sign in to comment.