订阅列表补充已付无回执快捷筛选
This commit is contained in:
@@ -90,6 +90,8 @@
|
||||
<a href="{!! $buildQuickFilterUrl(['status' => null, 'expiry' => 'expired']) !!}" class="muted">已过期</a>
|
||||
<span class="muted">|</span>
|
||||
<a href="{!! $buildQuickFilterUrl(['status' => null, 'expiry' => 'expiring_7d']) !!}" class="muted">7天内到期</a>
|
||||
<span class="muted">|</span>
|
||||
<a href="{!! $buildQuickFilterUrl(['payment_status' => 'paid', 'receipt_status' => 'none']) !!}" class="muted">已付无回执</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Arr;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminSiteSubscriptionIndexShouldIncludePaidNoReceiptQuickFilterTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected function loginAsPlatformAdmin(): void
|
||||
{
|
||||
$this->seed();
|
||||
|
||||
$this->post('/admin/login', [
|
||||
'email' => 'platform.admin@demo.local',
|
||||
'password' => 'Platform@123456',
|
||||
])->assertRedirect('/admin');
|
||||
}
|
||||
|
||||
public function test_site_subscription_index_should_include_paid_no_receipt_quick_filter(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$res = $this->get('/admin/site-subscriptions?' . Arr::query([
|
||||
'merchant_id' => 2,
|
||||
'plan_id' => 3,
|
||||
'keyword' => 'alpha',
|
||||
'back' => '/admin/plans',
|
||||
]));
|
||||
$res->assertOk();
|
||||
|
||||
$html = (string) $res->getContent();
|
||||
$this->assertStringContainsString('已付无回执', $html);
|
||||
|
||||
$matched = preg_match('/<a[^>]+href="([^"]+)"[^>]*>\s*已付无回执\s*<\/a>/u', $html, $m);
|
||||
$this->assertSame(1, $matched, '未找到订阅列表页“已付无回执”快捷筛选');
|
||||
|
||||
$href = html_entity_decode($m[1] ?? '');
|
||||
$parts = parse_url($href);
|
||||
parse_str($parts['query'] ?? '', $q);
|
||||
|
||||
$this->assertSame('2', (string) ($q['merchant_id'] ?? ''));
|
||||
$this->assertSame('3', (string) ($q['plan_id'] ?? ''));
|
||||
$this->assertSame('alpha', (string) ($q['keyword'] ?? ''));
|
||||
$this->assertSame('paid', (string) ($q['payment_status'] ?? ''));
|
||||
$this->assertSame('none', (string) ($q['receipt_status'] ?? ''));
|
||||
$this->assertSame('/admin/plans', (string) ($q['back'] ?? ''));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user