fix(formating)

This commit is contained in:
Anatoliy Poloz
2026-01-28 03:36:26 +03:00
parent 1723177949
commit b15d29f8e9
313 changed files with 1863 additions and 1533 deletions

View File

@@ -3,11 +3,11 @@
use Apoloz\AlfaBank\Utils\CardEncryptor;
use Apoloz\AlfaBank\Utils\CmsSigner;
test('can encrypt card pan', function () {
test('can encrypt card pan', function (): void {
// Generate a temporary RSA key for testing
$res = openssl_pkey_new([
"private_key_bits" => 2048,
"private_key_type" => OPENSSL_KEYTYPE_RSA,
'private_key_bits' => 2048,
'private_key_type' => OPENSSL_KEYTYPE_RSA,
]);
openssl_pkey_export($res, $privateKey);
$details = openssl_pkey_get_details($res);
@@ -20,17 +20,17 @@ test('can encrypt card pan', function () {
->and(base64_decode($encrypted))->not->toBeFalse();
});
test('can canonicalize json', function () {
test('can canonicalize json', function (): void {
$data = [
'z' => 1,
'a' => [
'c' => 3,
'b' => 2
]
'b' => 2,
],
];
$canonical = CmsSigner::canonicalize($data);
// Keys should be sorted: a (then b, c), z
expect($canonical)->toBe('{"a":{"b":2,"c":3},"z":1}');
});