34 lines
893 B
PHP
34 lines
893 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
class AdminDashboardRecentPlatformOrderLinksShouldCarryBackTest 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_dashboard_recent_platform_order_links_should_carry_back(): void
|
|
{
|
|
$this->loginAsPlatformAdmin();
|
|
|
|
$res = $this->get('/admin');
|
|
$res->assertOk();
|
|
|
|
// 从仪表盘点进订单详情后,应能通过 back 回到 /admin
|
|
$res->assertSee('href="/admin/platform-orders/1?back=%2Fadmin"', false);
|
|
$res->assertDontSee('&back=', false);
|
|
}
|
|
}
|