Files
portal/app/tests/Unit/Billing/SystemSettingsHelperTest.php
T

24 lines
685 B
PHP

<?php
declare(strict_types=1);
use App\Support\SystemSettings;
use Illuminate\Support\Facades\DB;
uses(Tests\TestCase::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();
});