Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete reference to random data functions + related pre-existing entity in database #64

Open
nzurita opened this issue Mar 7, 2024 · 1 comment
Labels

Comments

@nzurita
Copy link

nzurita commented Mar 7, 2024

Hello, where can I find a complete reference to functions like <firstName()>, <lastName()>, <sentence()> etc.? I'm unable to find it in the docs.

And... Is there a function to reference a related pre-existing entity in database? This entity is not loaded in any fixture but already exists in database and has a relation to current entity in fixture.

Thank you.

@theofidry
Copy link
Owner

Hi!

where can I find a complete reference to functions like <firstName()>, <lastName()>, <sentence()> etc.? I'm unable to find it in the docs.

You can find more information about this here, including how to register your own.

And... Is there a function to reference a related pre-existing entity in database? This entity is not loaded in any fixture but already exists in database and has a relation to current entity in fixture.

IIRC, if you are using the underlying loader in your tests (to load specific files, as opposed to the generic load all fixtures based on an environment), you can fetch entities beforehand and pass them as existing object to the loader. In this case they can be referenced by the fixtures.

I don't remember the exact specifics though so you would need to dig a little bit there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants