Files
portal/app/tests/Unit/Billing/SystemSettingsHelperTest.php
T
Дмитрий a9714c8c5d feat(billing): развилка topup по флагу billing_yookassa_enabled — шлюз vs заглушка
Флаг ВКЛ → создание платежа через OnlineTopupService + confirmation_url;
ВЫКЛ → прежнее мгновенное зачисление. Биндинг PaymentGatewayDriver в
AppServiceProvider. Также мелкая гигиена SystemSettingsHelperTest
(DatabaseTransactions для отката).
2026-06-22 21:36:30 +03:00

25 lines
770 B
PHP

<?php
declare(strict_types=1);
use App\Support\SystemSettings;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\DB;
uses(Tests\TestCase::class, DatabaseTransactions::class);
it('читает bool-флаг из system_settings', function () {
DB::table('system_settings')->updateOrInsert(
['key' => 'billing_yookassa_enabled'],
['value' => 'true', 'type' => 'bool', 'updated_at' => now()]
);
expect(SystemSettings::bool('billing_yookassa_enabled'))->toBeTrue();
});
it('возвращает default если ключа нет', function () {
DB::table('system_settings')->where('key', 'no_such_flag_xyz')->delete();
expect(SystemSettings::bool('no_such_flag_xyz', false))->toBeFalse();
});