Make optional the auto-erase of the records, added by `haveInDatabase()`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách xác định phần triển khai của haveInDatabase() và phần xử lý cấu hình cho skip_cleanup_if_failed. Theo dõi nơi các bản ghi được tự động xóa sau các bài kiểm thử, sau đó xác nhận rằng thiết lập boolean đã chọn có thể vô hiệu hóa hành vi đó trong khi vẫn giữ nguyên giá trị mặc định hiện có và hành vi dọn dẹp khi thất bại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Ngôn ngữ chính
- PHP
- Star
- 23
- Fork
- 31
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Codeception/module-db
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
Codeception/module-db#87 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Codeception/module-db#85 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Codeception/module-db#67 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
Codeception/module-db#58 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Codeception/module-db#54 ·
Tất cả issue của Codeception/module-db
Issue tương tự
-
jira-created
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
nunomaduro/phpinsights#745 ·
-
status/awaiting_triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
WordPress/plugin-check#1486 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
az-digital/az_quickstart#6019 ·