Unable to use `Examples` attribute
まだ誰も着手していません。
評価
調査の方向性
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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Codeception/codeception.github.com のほかの issue
-
change twitter to x オープン
Codeception/codeception.github.com#893 · 担当者 1 名 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
-
Dark mode please オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Codeception/codeception.github.com#569 · リアクション 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Codeception/codeception.github.com#529 · コメント 3 件 · リアクション 1 件 ·
Codeception/codeception.github.com の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
melgarafael/DeskcommCRM#1445 ·
-
area:dictation documentation P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
uttrflow/uttrflow-swift#1180 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
checkstyle/test-configs#263 ·
-
fix(errors): EHOSTUNREACH from a happy-eyeballs connect is reported as a resolver error (STAMP-80) オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
snapshot-labs/stamp#666 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
GauravKarakoti/SecureFlow#1070 · コメント 1 件 ·