Codeception / Codeception/module-doctrine

How to use Doctrine Module with Relations?

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

説明

#### What are you trying to achieve?
i would like to add a product with a related category.
```
$category = [
'id' => 'CATEGORY_ID',
'title' => 'Test Category',
];

$product = [
'id' => 'PRODUCT_ID',
'title' => 'My Test Product',
'category' => 'CATEGORY_ID',
];
$I->haveInRepository('Entity\Category', $category);
$I->haveInRepository('Entity\Product', $product);
```
#### What do you get instead?
setting `category` to a string ` [Doctrine\ORM\ORMInvalidArgumentException] Expected value of type "Entity\Category" for...`
using `categoryID` as key leads to a category set to null (using propel before doctrine, i thought that this might work).

in general it sould be documented that invalid fields are dropped. i think this should throw an exception (should this go into different ticket?).

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

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

調査の方向性

Start at the Doctrine module's haveInRepository entry point and reproduce the Category/Product relation example from the issue. Determine whether the requested outcome is documentation for relation values, an exception for invalid fields, or both; done requires an agreed scope and corresponding documented behavior or tests.

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

評価

技術スタック
php
領域
databases, testing
issue の種類
ドキュメント
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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