|
|
@@ -276,6 +276,26 @@ class WageringTest extends TestCase
|
|
|
$this->assertSame('20.0000000000', WageringService::platformRequirement('10'));
|
|
|
$this->assertSame(['30.0000000000', true], ManualAuditService::wagerDelta(false, '10', '注册赠送', null, '30'));
|
|
|
$this->assertSame(['0.0000000000', true], ManualAuditService::wagerDelta(false, '10', '优惠活动', null, null));
|
|
|
+ foreach (['神秘彩金', '其他'] as $type) {
|
|
|
+ $this->assertContains($type, BalanceLogService::$manualRecharge);
|
|
|
+ $this->assertContains($type, BalanceLogService::$RW);
|
|
|
+ $this->assertNotContains($type, BalanceLogService::$levelRechargeTypes, '不参与任何活动');
|
|
|
+ }
|
|
|
+ $this->assertSame(['30.0000000000', true], ManualAuditService::wagerDelta(false, '10', '神秘彩金', null, '30'));
|
|
|
+ $this->assertSame(['-5.0000000000', true], ManualAuditService::wagerDelta(true, '10', '人工扣款', '神秘彩金', '5'));
|
|
|
+ // 其他:按平台倍数,忽略填写值;不走充值钩子所以需在此处写入
|
|
|
+ $this->assertSame(['20.0000000000', true], ManualAuditService::wagerDelta(false, '10', '其他', null, '999'));
|
|
|
+ $this->assertSame(['-20.0000000000', true], ManualAuditService::wagerDelta(true, '10', '人工扣款', '其他', '999'));
|
|
|
+ // 按平台倍数的类型不解析 wager_amount;自填类型遇到 bcmath 不接受的写法给出业务错误而非 500
|
|
|
+ $this->assertSame(['20.0000000000', true], ManualAuditService::wagerDelta(false, '10', '其他', null, '1e2'));
|
|
|
+ $this->assertSame(['-20.0000000000', true], ManualAuditService::wagerDelta(true, '10', '人工扣款', '其他', '1e2'));
|
|
|
+ $this->assertSame(['0', false], ManualAuditService::wagerDelta(true, '10', '人工扣款', null, '1e2'));
|
|
|
+ try {
|
|
|
+ ManualAuditService::wagerDelta(false, '10', '神秘彩金', null, '1e2');
|
|
|
+ $this->fail('自填打码量格式错误应被拒绝');
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ $this->assertSame('打码量格式不正确', $e->getMessage());
|
|
|
+ }
|
|
|
$this->assertSame(['-20.0000000000', true], ManualAuditService::wagerDelta(true, '10', '人工扣款', '人工充值', '999'));
|
|
|
$this->assertSame(['-5.0000000000', true], ManualAuditService::wagerDelta(true, '10', '人工扣款', '优惠活动', '5'));
|
|
|
$this->assertSame(['0', false], ManualAuditService::wagerDelta(true, '10', '人工扣款', null, null));
|