Fix reconcile mismatch predicate and align batch activate governance tests
This commit is contained in:
@@ -70,6 +70,7 @@ class AdminPlatformOrderBatchActivateSubscriptionsReconcileMismatchFilterFieldsT
|
||||
$page->assertSee('value="1"', false);
|
||||
|
||||
// 执行批量同步(filtered scope 且必须 syncable_only=1 才能提交)
|
||||
// 治理优先:当筛选集合包含 reconcile_mismatch=1 时,应触发安全阀阻断同步
|
||||
$res = $this->post('/admin/platform-orders/batch-activate-subscriptions', [
|
||||
'scope' => 'filtered',
|
||||
'syncable_only' => '1',
|
||||
@@ -78,9 +79,9 @@ class AdminPlatformOrderBatchActivateSubscriptionsReconcileMismatchFilterFieldsT
|
||||
]);
|
||||
|
||||
$res->assertRedirect();
|
||||
$res->assertSessionHas('warning');
|
||||
|
||||
// 至少验证该订单确实被命中并写入 subscription_activation.subscription_id
|
||||
$order->refresh();
|
||||
$this->assertNotEmpty(data_get($order->meta, 'subscription_activation.subscription_id'));
|
||||
$this->assertEmpty(data_get($order->meta, 'subscription_activation'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,20 +84,21 @@ class AdminPlatformOrderBatchActivateSubscriptionsRefundInconsistentFilterFields
|
||||
]);
|
||||
|
||||
// 批量同步订阅:filtered scope 必须带 syncable_only=1;并附加 refund_inconsistent=1
|
||||
$this->post('/admin/platform-orders/batch-activate-subscriptions', [
|
||||
// 治理优先:当筛选集合包含 refund_inconsistent=1 时,应触发安全阀阻断同步
|
||||
$res = $this->post('/admin/platform-orders/batch-activate-subscriptions', [
|
||||
'scope' => 'filtered',
|
||||
'syncable_only' => '1',
|
||||
'refund_inconsistent' => '1',
|
||||
'limit' => 50,
|
||||
])->assertRedirect();
|
||||
]);
|
||||
$res->assertRedirect();
|
||||
$res->assertSessionHas('warning');
|
||||
|
||||
$a->refresh();
|
||||
$b->refresh();
|
||||
|
||||
// A 应被同步(meta.subscription_activation.subscription_id 存在)
|
||||
$this->assertNotNull(data_get($a->meta, 'subscription_activation.subscription_id'));
|
||||
|
||||
// B 不应被同步
|
||||
// 安全阀触发:A/B 都不应被同步
|
||||
$this->assertNull(data_get($a->meta, 'subscription_activation.subscription_id'));
|
||||
$this->assertNull(data_get($b->meta, 'subscription_activation.subscription_id'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user