Codeception / Codeception/module-doctrine
Doctrine2 Module: Is `flush()` before checking the database so necessary?
- 主要言語
- PHP
- スター
- 4
- フォーク
- 2
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Why do we flush managed Doctrine entities before checking the database in [`Doctrine2::proceedSeeInRepository()`](https://github.com/Codeception/Codeception/blob/bd6ad8af1fa7cd12684f0287374b9fe71a8c958a/src/Codeception/Module/Doctrine2.php#L378)?
In functional tests the Entity Manager of application is used in the Codeception Doctrine2 Module. If we do test a request with validation rejection, and we want to be sure the database was not changed, the test result will be false negative (the request fetches and populates some entity, but didn't save changes to the database, and then `dontSeeInRepository()` flushes the invalid entity to the database and does fail).
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Start in src/Codeception/Module/Doctrine2.php at Doctrine2::proceedSeeInRepository(), especially the flush before the database check. Review the issue's validation-rejection scenario and existing module tests, then verify that checking repository contents does not persist fetched or invalid managed-entity changes; the relevant tests should pass without false negatives.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- databases, testing
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100