feat: 更新 .env.example 文件,新增彩票业务配置与 Redis、邮件、队列等环境变量,优化开发环境设置

This commit is contained in:
2026-05-08 17:26:01 +08:00
parent 8cce1778b9
commit 85e57782cc
12 changed files with 663 additions and 54 deletions

View File

@@ -0,0 +1,30 @@
<?php
use App\Models\LotterySetting;
use App\Services\LotterySettings;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Cache;
uses(RefreshDatabase::class);
test('lottery settings get returns seeded value', function (): void {
LotterySettings::put('fixture.flag', true, 'test', null);
expect(LotterySettings::get('fixture.flag'))->toBeTrue();
});
test('lottery settings misses are not cached', function (): void {
Cache::flush();
expect(LotterySettings::get('not.exists', 'fallback'))->toBe('fallback');
LotterySetting::query()->create([
'setting_key' => 'not.exists',
'value_json' => 'hello',
'group_name' => 'test',
]);
LotterySettings::forgetKey('not.exists');
expect(LotterySettings::get('not.exists'))->toBe('hello');
});