Files
saasshop/tests/Feature/AdminPlatformOrderIndexBatchBmpaRunIdBadgeShouldRenderTest.php

43 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexBatchBmpaRunIdBadgeShouldRenderTest 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_platform_orders_page_should_render_batch_bmpa_run_id_badge_and_quick_links(): void
{
$this->loginAsPlatformAdmin();
$runId = 'BMPA_TEST_BADGE_0001';
$html = $this->get('/admin/platform-orders?batch_bmpa_run_id=' . $runId)
->assertOk()
->getContent();
$this->assertStringContainsString('当前 BMPA run_id<strong>' . $runId . '</strong>', $html);
// 快捷入口:本批次失败(应带 batch_bmpa_run_id + bmpa_failed_only=1
$this->assertStringContainsString('batch_bmpa_run_id=' . $runId, $html);
$this->assertStringContainsString('bmpa_failed_only=1', $html);
// 快捷入口本批次可再次尝试pending+unpaid
$this->assertStringContainsString('status=pending', $html);
$this->assertStringContainsString('payment_status=unpaid', $html);
}
}