This commit is contained in:
2026-03-12 16:26:34 +08:00
parent 2ca386ca20
commit 26caea9a05
2 changed files with 7 additions and 4 deletions
@@ -281,8 +281,8 @@ class PermissionMiddlewareTest extends TestCase
$response = $this->get('/api/v1/users', [], $this->authHeaders($user));
$response->assertStatus(403);
} finally {
// 恢复路由记录
Route::query()->create($route_data);
// 恢复路由记录(使用 Db::table 保留原 id
Db::table('routes')->insert($route_data);
}
}
@@ -304,8 +304,8 @@ class PermissionMiddlewareTest extends TestCase
$response = $this->get('/api/v1/users', [], $this->authHeaders($user));
$response->assertStatus(200);
} finally {
// 恢复路由记录
Route::query()->create($route_data);
// 恢复路由记录(使用 Db::table 保留原 id
Db::table('routes')->insert($route_data);
}
}