Codeception / Codeception/module-doctrine
How to use Doctrine Module with Relations?
- Lingua principale
- PHP
- Stelle
- 4
- Fork
- 2
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
#### 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?).
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- php
- Ambito
- databases, testing
- Tipo di issue
- Documentazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100