test(governance): batchMarkActivated blocks mismatch/refund scopes
This commit is contained in:
@@ -106,22 +106,29 @@ class AdminPlatformOrderBatchMarkActivatedFilterFieldsTest extends TestCase
|
||||
],
|
||||
]);
|
||||
|
||||
// 批量生效:过滤条件=已支付+待处理 + 无回执 + 无退款 + 对账不一致,只应推进 A
|
||||
// 治理口径升级:当筛选命中「无回执/对账不一致」等治理集合时,不允许直接批量仅标记为已生效。
|
||||
// 这里用测试锁定:应直接被阻断,并给出 warning;订单状态不应发生变化。
|
||||
$this->post('/admin/platform-orders/batch-mark-activated', [
|
||||
'scope' => 'filtered',
|
||||
'payment_status' => 'paid',
|
||||
'status' => 'pending',
|
||||
'sync_status' => 'unsynced',
|
||||
'receipt_status' => 'none',
|
||||
'refund_status' => 'none',
|
||||
'reconcile_mismatch' => '1',
|
||||
'limit' => 50,
|
||||
])->assertRedirect();
|
||||
])
|
||||
->assertRedirect()
|
||||
->assertSessionHas('warning', function ($msg) {
|
||||
$msg = (string) $msg;
|
||||
return str_contains($msg, '无回执') || str_contains($msg, '回执');
|
||||
});
|
||||
|
||||
$a->refresh();
|
||||
$b->refresh();
|
||||
$c->refresh();
|
||||
|
||||
$this->assertSame('activated', $a->status);
|
||||
$this->assertSame('pending', $a->status);
|
||||
$this->assertSame('pending', $b->status);
|
||||
$this->assertSame('pending', $c->status);
|
||||
}
|
||||
|
||||
@@ -81,18 +81,26 @@ class AdminPlatformOrderBatchMarkActivatedRefundInconsistentFilterFieldsTest ext
|
||||
'meta' => [],
|
||||
]);
|
||||
|
||||
// 治理口径升级:当筛选命中「退款不一致」治理集合时,不允许直接批量仅标记为已生效。
|
||||
// 这里用测试锁定:应直接被阻断,并给出 warning;订单状态不应发生变化。
|
||||
$this->post('/admin/platform-orders/batch-mark-activated', [
|
||||
'scope' => 'filtered',
|
||||
'payment_status' => 'paid',
|
||||
'status' => 'pending',
|
||||
'sync_status' => 'unsynced',
|
||||
'refund_inconsistent' => '1',
|
||||
'limit' => 50,
|
||||
])->assertRedirect();
|
||||
])
|
||||
->assertRedirect()
|
||||
->assertSessionHas('warning', function ($msg) {
|
||||
$msg = (string) $msg;
|
||||
return str_contains($msg, '退款不一致') || str_contains($msg, '对账不一致');
|
||||
});
|
||||
|
||||
$a->refresh();
|
||||
$b->refresh();
|
||||
|
||||
$this->assertSame('activated', $a->status);
|
||||
$this->assertSame('pending', $a->status);
|
||||
$this->assertSame('pending', $b->status);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user