23 lines
634 B
PHP
23 lines
634 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\PaymentGateway;
|
|
use Illuminate\Support\Facades\Crypt;
|
|
|
|
uses(Tests\TestCase::class);
|
|
|
|
it('расшифровывает config в массив через accessor', function () {
|
|
$gw = new PaymentGateway;
|
|
$gw->config = Crypt::encrypt(['shop_id' => '123', 'secret_key' => 'test_secret']);
|
|
|
|
expect($gw->credentials())->toBe(['shop_id' => '123', 'secret_key' => 'test_secret']);
|
|
});
|
|
|
|
it('возвращает пустой массив если config пустой', function () {
|
|
$gw = new PaymentGateway;
|
|
$gw->config = '';
|
|
|
|
expect($gw->credentials())->toBe([]);
|
|
});
|