test(config): align current odds and settlement contracts
This commit is contained in:
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user