Make optional the auto-erase of the records, added by `haveInDatabase()`
還沒有人認領這個 Issue。
評估
研究方向
先定位 haveInDatabase() 的實作以及 skip_cleanup_if_failed 的設定處理邏輯。追蹤測試後記錄自動刪除的位置,然後確認所選的布林設定可以停用該行為,同時保留現有的預設值和失敗時的清理行為。
由索引模型根據 Issue 內容生成。
描述
Problem
Currently, all records, added by haveInDatabase() method during test, are automatically removed after the end of the test.
Although this is a documented behaviour, for me it adds more confusion than profit.
In case when I need all the changes, made during test, to disappear after the test, I can't rely solely on this behaviour, because changes may be done not only by haveInDatabase(). So I still need to use other things for keeping tests isolated (wrapping tests in transactions, or to re-populate database from dump before each test, etc).
And in other case, when I do not need tests isolation, I am ok with the fact that each test changes something in database, so auto-erasing some records only adds confusion for me.
So, I'd like to be able to turn this behaviour off in my tests.
Currently we have a skip_cleanup_if_failed configuration parameter, but it does not give full control over the auto-erase, because allows to omit it only when tests fail (which should be the default behaviour, IMHO). Also, its name is confusing (see issue #67).
Proposed solution
Let's add another boolean configuration parameter, responsible for this auto-erase. For example, auto_erase, or cleanup (could be used after renaming current cleanup to repopulate - see issue #67)
- 主要語言
- PHP
- 星號
- 23
- 分支
- 31
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Codeception/module-db 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 42/100
Codeception/module-db#87 ·
-
難度 4/5 3-5 天 新手友好度 25/100
Codeception/module-db#85 ·
-
難度 4/5 3-5 天 新手友好度 35/100
Codeception/module-db#67 ·
-
難度 3/5 1-2 天 新手友好度 38/100
Codeception/module-db#58 ·
-
難度 3/5 1-2 天 新手友好度 45/100
Codeception/module-db#54 ·
查看 Codeception/module-db 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
難度 2/5 1 小時以內 新手友好度 70/100
維護者通常 1 天內回覆
-
customer-support needs-triage Platform(Default)
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
grokability/snipe-it#19767 ·
維護者通常 1 天內回覆