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
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 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
-
a11y admissions.uiowa.edu needs grooming SiteImprove best practice
难度 2/5 1-3 小时 新手友好度 70/100
-
Save States Menu 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 84/100
pluginsGLPI/datainjection#673 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
octobercms/october#6130 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
getgrav/grav-plugin-form#656 ·