Skip to content

Commit

Permalink
Mention loading fixtures via symfony console command in README (#18)
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob Dreesen <j.dreesen@neusta.de>
  • Loading branch information
m0nken and jdreesen authored May 14, 2024
1 parent 626c74a commit 5c080fa
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,19 @@ final class MyCustomTest extends BaseKernelTestCase
}
```

To load fixtures in your local environment or as part of a deployment two commands are provided:
- `neusta:pimcore-fixture:load` (Loads a defined fixture class.)
- `neusta:pimcore-fixtures:load` (Loads all defined fixture classes.)

Beware that loading a large amount of objects may lead to a high consumption of memory.
Should you encounter memory issues when running the commands in `dev` environments you may want to try
setting the environment to `prod`. Disabling the debug mode also seems to be beneficial in terms of memory consumption.

For example provide these options when using the symfony console:
```shell
bin/console --env=prod --no-debug neusta:pimcore-fixtures:load
```

### Accessing Services from the Fixtures

As the Fixtures are just normal PHP Services you can use all DI features like constructor, setter or property injection as usual.
Expand Down

0 comments on commit 5c080fa

Please sign in to comment.