测试: 升级批量生效阻断提示语义护栏
This commit is contained in:
@@ -23,16 +23,27 @@ class AdminPlatformOrderIndexBatchMarkActivatedBlockedHintShouldIncludeGoPending
|
|||||||
{
|
{
|
||||||
$this->loginAsPlatformAdmin();
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
// 构造一个会触发 batch_mark_activated 被阻断的筛选:缺少 sync_status=unsynced。
|
// 构造一个会触发 batch_mark_activated 被阻断的复杂筛选;
|
||||||
$res = $this->get('/admin/platform-orders?payment_status=paid&status=pending');
|
// blocked hint 应给出“切到待生效集合”入口,并清理冲突开关。
|
||||||
|
$res = $this->get('/admin/platform-orders?payment_status=paid&status=pending&sync_status=failed&bmpa_failed_only=1&page=2&back=/admin');
|
||||||
$res->assertOk();
|
$res->assertOk();
|
||||||
|
|
||||||
$html = (string) $res->getContent();
|
$html = (string) $res->getContent();
|
||||||
|
|
||||||
$this->assertStringContainsString('data-role="batch-mark-activated-blocked-hint"', $html);
|
$this->assertStringContainsString('data-role="batch-mark-activated-blocked-hint"', $html);
|
||||||
$this->assertStringContainsString('切到待生效集合', $html);
|
$this->assertMatchesRegularExpression('/href="([^"]+)"[^>]*>切到待生效集合<\/a>/', $html);
|
||||||
$this->assertStringContainsString('payment_status=paid', $html);
|
|
||||||
$this->assertStringContainsString('status=pending', $html);
|
preg_match('/href="([^"]+)"[^>]*>切到待生效集合<\/a>/', $html, $m);
|
||||||
$this->assertStringContainsString('sync_status=unsynced', $html);
|
$href = html_entity_decode((string) ($m[1] ?? ''));
|
||||||
|
|
||||||
|
$query = parse_url($href, PHP_URL_QUERY) ?: '';
|
||||||
|
parse_str($query, $q);
|
||||||
|
|
||||||
|
$this->assertSame('paid', (string) ($q['payment_status'] ?? ''));
|
||||||
|
$this->assertSame('pending', (string) ($q['status'] ?? ''));
|
||||||
|
$this->assertSame('unsynced', (string) ($q['sync_status'] ?? ''));
|
||||||
|
$this->assertSame('/admin', (string) ($q['back'] ?? ''));
|
||||||
|
$this->assertArrayNotHasKey('page', $q);
|
||||||
|
$this->assertArrayNotHasKey('bmpa_failed_only', $q);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user