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

How to change the default fixtures directory? #114

Open
dariusmann opened this issue May 11, 2021 · 3 comments
Open

How to change the default fixtures directory? #114

dariusmann opened this issue May 11, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@dariusmann
Copy link

The default fixtures directory is src/DataFixtures.

I want this folder in my src/tests folder.

Where I can configure the library to load the fixture from src/tests/DataFixtures?

@dariusmann dariusmann changed the title How to change the default fixture directory? How to change the default fixtures directory? May 11, 2021
@alexislefebvre
Copy link
Collaborator

Fixtures can be put anywhere you want.

See these examples:

$this->databaseTool->loadFixtures([
'Liip\Acme\Tests\App\DataFixtures\ORM\LoadUserData',
]);

$fixtures = $this->databaseTool->loadAliceFixture([
'@AcmeBundle/DataFixtures/ORM/user.yml',
]);

@dariusmann
Copy link
Author

Ok, thanks. Is there any way to configure it in one place? Like global config.

@alexislefebvre
Copy link
Collaborator

Not at the moment. But you can create a base class with an helper method to use a default path. Then extend that class in each of your test classes and call that method. Example of base class that is extended.

@alexislefebvre alexislefebvre added the enhancement New feature or request label Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants