Codeception / Codeception/module-doctrine

haveFakeRepository from Doctrine module doesn't work

オープン
#20 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
PHP
スター
4
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

説明

#### What are you trying to achieve?
Mock repository with haveFakeRepository method from Doctrine module.

#### What do you get instead?

> Provide console output if related. Use `-vvv` mode for more details.

```bash
[Warning] Repository can't be mocked, the EventManager's repositoryFactory doesn't have "repositoryList" property

```
> Provide test source code if related

```php
$I->haveFakeRepository('App\Entity\User', array('findOneBy' => function ($args) use ($user) {
return $user;
}));
```
### Details

* Codeception version: 2.4.1
* PHP Version: 7.2.4
* Operating System: 16.04.1-Ubuntu
* Installation type: Composer
* List of installed packages (`composer show`)
```bash
doctrine/orm v2.5.13 Object-Relational-Mapper for PHP
symfony/framework-bundle v4.0.8 Symfony FrameworkBundle
```
* Suite configuration:

```yml
actor: ApiTester
modules:
enabled:
- Symfony:
app_path: src
environment: test
params: .env
- REST:
url: /api
depends: Symfony
- Doctrine2:
depends: Symfony
- \Helper\Api```

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

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

調査の方向性

Start at the Doctrine module's haveFakeRepository method and trace the EventManager repositoryFactory handling that produces the missing "repositoryList" warning. Reproduce the issue with the shown Codeception, Doctrine ORM, Symfony, PHP, and suite configuration; done means the App\Entity\User repository can be mocked as shown without the warning.

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

評価

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

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

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