seed(CurrencySeeder::class); }); test('public settings requires allowed group', function (): void { $this->getJson('/api/v1/settings') ->assertStatus(400) ->assertJsonPath('code', ErrorCode::ClientHttpError->value); $this->getJson('/api/v1/settings?group=wallet') ->assertStatus(400) ->assertJsonPath('code', ErrorCode::ClientHttpError->value); }); test('public settings returns currency group', function (): void { \App\Models\LotterySetting::query()->updateOrCreate( ['setting_key' => 'currency.display_decimals'], [ 'group_name' => 'currency', 'value_json' => 3, 'description_zh' => '展示小数位', ], ); $this->getJson('/api/v1/settings?group=currency') ->assertOk() ->assertJsonPath('code', ErrorCode::Success->value) ->assertJsonFragment(['key' => 'currency.display_decimals', 'value' => 3]); }); test('public settings returns frontend group only', function (): void { \App\Models\LotterySetting::query()->updateOrCreate( ['setting_key' => 'frontend.play_rules_html_zh'], [ 'group_name' => 'frontend', 'value_json' => '

rules

', 'description_zh' => '规则', ], ); $this->getJson('/api/v1/settings?group=frontend') ->assertOk() ->assertJsonPath('code', ErrorCode::Success->value) ->assertJsonFragment(['key' => 'frontend.play_rules_html_zh']); });