Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`haveInRepository` gives constructor parameter missing?

オープン
#5 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
php
領域
database

調査の方向性

haveInRepository の実装から始め、Process と QueueItem の例で名前付きコンストラクター引数がどのように解決されるかを追跡します。報告されたケースを焦点を絞ったテストで再現し、既存のコンストラクター引数のテストを確認します。完了の条件は、動作がドキュメント化された例と一致すること、またはドキュメントにサポートされる制限が明確に記載されていることです。

索引モデルが issue の本文から書いたものです。

説明

/**
 * @ORM\Entity
 * @ORM\Table("processes")
 */
class Process extends Entity
{
    /**
     * @ORM\ManyToOne(inversedBy="processes")
     * @ORM\JoinColumn(nullable=false)
     */
    private QueueItem $queueItem;

    public function __construct(QueueItem $queueItem)
    {
        $this->queueItem = $queueItem;
    }
}

In test:

$processId = $this->tester->haveInRepository(Process::class, [
    'queueItem' => ['name' => 'queue item name']
]);

Throws exception:

InvalidArgumentException : Constructor parameter "queueItem" missing

If I read the documentation correctly for haveInRepository:

Alternatively, constructor arguments can be passed by name. Given User constructor signature is __constructor($arg), the example above could be rewritten like this: $I->haveInRepository(User::class, ['arg' => $arg, 'name' => 'davert']);

It should actually instantiate the QueueItem and pass it as the argument into the Process constructor or does it only work with scalar types?

主要言語
PHP
スター
4
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Codeception/module-doctrine のほかの issue

Codeception/module-doctrine の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。