test(config): align current odds and settlement contracts

This commit is contained in:
wchino
2026-07-21 23:41:18 +08:00
parent 457d2cc9e5
commit 150c3e7ebd
11 changed files with 93 additions and 163 deletions

View File

@@ -10,14 +10,23 @@ uses(RefreshDatabase::class);
beforeEach(fn () => $this->seed(PlayTypeSeeder::class));
test('every play_types.play_code maps to a non-noop settlement matcher', function (): void {
test('every enabled play type maps to a non-noop settlement matcher', function (): void {
$reg = app(SettlementMatcherRegistry::class);
foreach (PlayType::query()->orderBy('play_code')->pluck('play_code') as $code) {
foreach (PlayType::query()->where('is_enabled', true)->orderBy('play_code')->pluck('play_code') as $code) {
$matcher = $reg->for((string) $code);
expect($matcher)->not->toBeInstanceOf(NoopSettlementMatcher::class);
}
});
test('independent draw plays stay disabled until their settlement matchers exist', function (): void {
$reg = app(SettlementMatcherRegistry::class);
foreach (['five_d', 'six_d'] as $code) {
expect(PlayType::query()->where('play_code', $code)->value('is_enabled'))->toBeFalse()
->and($reg->for($code))->toBeInstanceOf(NoopSettlementMatcher::class);
}
});
test('half_box reuses the same matcher instance as big spread', function (): void {
$reg = app(SettlementMatcherRegistry::class);
expect($reg->for('half_box'))->toBe($reg->for('big'));