有人可以解釋一下如何將一些物體添加到資料庫中以進行測驗嗎?我想測驗那個端點 /show/{id} 顯示正確的回應,但要檢查我是否需要在測驗資料庫中有一個物體,以便我可以下載他的資料。
我正在使用最新版本的 Symfony、Doctrine 和 PHP 單元。
uj5u.com熱心網友回復:
您正在尋找與 symfony 的集成測驗,并且您將面臨先決條件(夾具、測驗資料庫、通過WebTestCase類的 api 呼叫,...)。詳細解釋有點長,所以你想要的就是這個頁面:https ://symfony.com/doc/current/testing.html
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/471467.html
