Unable to use `Examples` attribute
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 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 việc xem cách sử dụng thuộc tính Examples trong issue và lỗi tại vendor/codeception/codeception/src/Codeception/Lib/Di.php:122, sau đó so sánh với hành vi mong đợi được mô tả trong #867. Được xem là hoàn thành khi Cest được hiển thị có thể nhận dữ liệu Codeception\Example và thực thi mà không có InjectionException.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I recently updated to codeception v5 - which works like a charm 😊
I just wanted to try out the new Examples Attribute. Unfortunately I get this:
use Codeception\Attribute\Examples;
use Codeception\Example;
use Symfony\Component\HttpFoundation\Response;
use Tests\Support\FunctionalTester;
final class LegacySeriesRedirectControllerCest
{
#[Examples(url: '/de/series/index', expected: 'asdf')]
public function foo(FunctionalTester $I, Example $example): void
{
$I->followRedirects(false);
$I->amOnPage($example['url']);
$I->seeRedirectTo($example['expected'], Response::HTTP_FOUND);
}
}
LegacySeriesRedirectControllerCest: Foo
Test tests/Functional/App/Controller/Frontend/LegacySeriesRedirectControllerCest.php:foo
[InjectionException] Failed to inject dependencies in instance of 'Functional\App\Controller\Frontend\LegacySeriesRedirectControllerCest'. Failed to create instance of 'Codeception\Example'. Parameter 'data' must have default value.
/path/to/project/okto/website/vendor/codeception/codeception/src/Codeception/Lib/Di.php:122
/path/to/project/okto/website/vendor/codeception/codeception/src/Codeception/Test/Cest.php:184
/path/to/project/okto/website/vendor/codeception/codeception/src/Codeception/Test/Cest.php:200
/path/to/project/okto/website/vendor/codeception/codeception/src/Codeception/Test/Cest.php:129
/path/to/project/okto/website/vendor/codeception/codeception/src/Codeception/Test/Test.php:168
/path/to/project/okto/website/vendor/codeception/codeception/src/Codeception/Suite.php:130
/path/to/project/okto/website/vendor/codeception/codeception/src/Codeception/SuiteManager.php:151
/path/to/project/okto/website/vendor/codeception/codeception/src/Codeception/Codecept.php:260
/path/to/project/okto/website/vendor/codeception/codeception/src/Codeception/Codecept.php:216
/path/to/project/okto/website/vendor/codeception/codeception/src/Codeception/Command/Run.php:435
/path/to/project/okto/website/vendor/symfony/console/Command/Command.php:326
/path/to/project/okto/website/vendor/symfony/console/Application.php:1078
/path/to/project/okto/website/vendor/symfony/console/Application.php:324
/path/to/project/okto/website/vendor/symfony/console/Application.php:175
/path/to/project/okto/website/vendor/codeception/codeception/src/Codeception/Application.php:112
/path/to/project/okto/website/vendor/codeception/codeception/app.php:45
/path/to/project/okto/website/vendor/codeception/codeception/app.php:46
/path/to/project/okto/website/vendor/codeception/codeception/codecept:7
/path/to/project/okto/website/vendor/bin/codecept:119
$ symfony composer info codeception/*
codeception/codeception 5.1.2 BDD-style testing framework
codeception/lib-asserts 2.1.0 Assertion methods used by Codeception core and Asserts module
codeception/lib-innerbrowser 4.0.5 Parent library for all Codeception framework modules and PhpBrowser
codeception/lib-web 1.0.6 Library containing files used by module-webdriver and lib-innerbrowser or module-phpbrowser
codeception/lib-xml 1.0.3 Files used by module-rest and module-soap
codeception/module-asserts 3.0.0 Codeception module containing various assertions
codeception/module-doctrine 3.1.0 Doctrine module for Codeception
codeception/module-rest 3.4.0 REST module for Codeception
codeception/module-symfony 3.5.0 Codeception module for Symfony framework
codeception/module-webdriver 4.0.2 WebDriver module for Codeception
codeception/stub 4.1.3 Flexible Stub wrapper for PHPUnit's Mock Builder
According to #867 this should work. What am I doing wrong?
- Ngôn ngữ chính
- HTML
- Star
- 24
- Fork
- 131
- 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/codeception.github.com
-
change twitter to x Đang mở
Codeception/codeception.github.com#893 · 1 người được giao ·
-
Drop "Use cases" pages Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
-
Dark mode please Đ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/codeception.github.com#569 · 2 reaction ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Codeception/codeception.github.com#529 · 3 bình luận · 1 reaction ·
Tất cả issue của Codeception/codeception.github.com
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
melgarafael/DeskcommCRM#1445 ·
-
The correction-threshold rationale says 17 restraint cases collide; the current corpus has 16 Đang mởarea:dictation documentation P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
uttrflow/uttrflow-swift#1180 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
checkstyle/test-configs#263 ·
-
fix(errors): EHOSTUNREACH from a happy-eyeballs connect is reported as a resolver error (STAMP-80) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
snapshot-labs/stamp#666 ·
-
fix(api): prevent leaderboard SSE heartbeat from starting after disconnect during initial load Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
GauravKarakoti/SecureFlow#1070 · 1 bình luận ·