[Feature] Per-unit and per-class fixture configuration - PR welcome?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu tại src/Codeception/Module/Yii2.php và kiểm tra loadFixtures(), sau đó xem lại các ví dụ được liên kết và phần triển khai được đề xuất. Xác nhận API mà dự án mong muốn cho các thuộc tính của lớp và bài kiểm thử, cũng như khả năng tương thích của chúng với fixturesMethod; công việc được xem là hoàn tất khi các giá trị mặc định, các ghi đè và hành vi vô hiệu hóa của fixture đã được thống nhất và bao quát.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Note: I may not be aware of all configuration options or available functionality, so please let me know if I'm missing something.
AFIK, there is the option to configure fixtures in the test configuration, as well as in the configured fixturesMethod (_fixtures).
In our project, humhub/humhub, we use the fixturesMethod to adjust the configured fixtures from the configuration based on the test case's need. Mainly to speed up tests that do not require db data or just a subset of it.
In some situations, however, it seems to make sense to collect several tests in one case, but only some of them do actually need the fixtures, or some need a different set.
Now we had the idea to use attributes to allow that fixtures to be configured: see examples and current suggested implementation (open for improvement).
The question of this issue is if there is interest that we would incorporate this feature into this project here, potentially in the loadFixtures() method. The logic could be
- If the
fixturesMethodis implemented, just use its result - Otherwise, check for class and test attributes and use their result, if present
If the new functionality is encapsulated in a public method (e.g. getTestFixtures()) and we would pass the yii2 module instance as an argument to the fixturesMethod for easy access, the fixturesMethod could still use that configuration and customize as required. By this, there would be full backwards-compatibility while supporting fixture configuration without the need to implement the fixturesMethod.
The annotations generally allow the following:
- define a default set of fixtures
- use a configuration array to reduce or extend the default set
- on test level, the class level can be overridden, also falling back to the original configuration
- a special class
FixturesNonewould simply disable any fixtures for the current test.
Thank you for considering this. Any feedback welcome.
Please note, the current code in the aforementioned PR is not designed to meet this project's guidelines. Happy to adapt accordingly if you'd be interested in considering an implementation in your code base.
- Ngôn ngữ chính
- PHP
- Star
- 19
- Fork
- 42
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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-yii2
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Codeception/module-yii2#145 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Codeception/module-yii2#144 · 1 bình luận · 1 reaction ·
-
MongoDB supportĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Codeception/module-yii2#142 · 4 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
Codeception/module-yii2#141 · 1 bình luận ·
-
Unable to load yii\elasticsearch\ActiveRecord-based fixturesCó thể làm lại được @Mikk36 đã nhận 386 ngày trước và không có pull request nào đang mở. Đang mở
Codeception/module-yii2#134 · 4 bình luận · 1 người được giao ·
Tất cả issue của Codeception/module-yii2
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Automattic/blocks-engine#2866 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
community-scripts/ProxmoxVE#17944 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
EasyCorp/EasyAdminBundle#7861 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Good first issue: add laravel-inertia stack budget preset (Laravel 11 + Inertia.js + PHP 8.3)Đang mởenhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
backend gamification P0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
semanadeinformatica/website#461 ·