Unable to use `Examples` attribute
還沒有人認領這個 Issue。
評估
研究方向
從 issue 中 Examples 屬性的使用方式以及 vendor/codeception/codeception/src/Codeception/Lib/Di.php:122 處的失敗開始,然後比較 #867 中描述的預期行為。當所示的 Cest 能夠接收 Codeception\Example 資料並在沒有 InjectionException 的情況下執行時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
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?
- 主要語言
- HTML
- 星號
- 24
- 分支
- 131
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Codeception/codeception.github.com 的其他 Issue
-
Codeception/codeception.github.com#893 · 已指派 1 人 ·
-
難度 2/5 1-3 小時 新手友好度 35/100
-
Dark mode please 未關閉
難度 5/5 一週以上 新手友好度 25/100
Codeception/codeception.github.com#569 · 2 個 reaction ·
-
難度 5/5 一週以上 新手友好度 25/100
Codeception/codeception.github.com#529 · 3 則留言 · 1 個 reaction ·
查看 Codeception/codeception.github.com 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 91/100
nesquena/hermes-webui#7735 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
openml/openml-python#1749 ·
-
難度 1/5 1 小時以內 新手友好度 88/100
-
難度 2/5 1-3 小時 新手友好度 86/100
melgarafael/DeskcommCRM#1445 ·
-
area:dictation documentation P2
難度 2/5 1-3 小時 新手友好度 78/100
uttrflow/uttrflow-swift#1180 ·