Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Add tests for Encrypter #51089

Merged

Conversation

saMahmoudzadeh
Copy link
Contributor

This PR, improvement test coverage for Encryptor class.

Test empty string data

$encrypted = $e->encrypt('');
$this->assertSame('', $e->decrypt($encrypted));

Test long string data

$longString = str_repeat('a', 1000);
$encrypted = $e->encrypt($longString);
$this->assertSame($longString, $e->decrypt($encrypted));

test array data

$data = ['foo' => 'bar', 'baz' => 'qux'];
$encryptedArray = $e->encrypt($data);
$this->assertNotSame($data, $encryptedArray);
$this->assertSame($data, $e->decrypt($encryptedArray));

Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@saMahmoudzadeh saMahmoudzadeh marked this pull request as ready for review April 16, 2024 21:30
@taylorotwell taylorotwell merged commit ed718c7 into laravel:11.x Apr 16, 2024
30 checks passed
@saMahmoudzadeh saMahmoudzadeh deleted the test/improvement-encryption branch April 16, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants