這個答案解決了我遇到的一個問題:在 phpunit 上運行 Phinx 播種者:
我有一個像你提到的情況,我需要在單元測試中在 mysql 資料庫上運行播種器,因此我執行了以下步驟:
namespace Tests use Phinx\Db\Adapter\MysqlAdapter; class TestAdapter extends MysqlAdapter { public function __construct(\PDO
上面的答案也給了這個問題的解:
給定一個 PDO 實例,我如何也可以建立一個 MysqlConnectionAdapter?
歡迎對上述問題提出改進或建議。這是我的一個解決方案,可能會有一些警告。
以上是答:我如何運行特定的phinx seeder並在phpunit中取得產生的記錄?的詳細內容。更多資訊請關注PHP中文網其他相關文章!