Skip to content

Commit

Permalink
Added explanation for the necessity of registering Fixtures as a serv…
Browse files Browse the repository at this point in the history
…ice (#21)
  • Loading branch information
nehlsen authored Sep 11, 2024
1 parent 9a2486a commit e589253
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ It can be useful for testing purposes, or for seeding a database with initial da
Neusta\Pimcore\FixtureBundle\NeustaPimcoreFixtureBundle::class => ['test' => true],
```

3. **Register your Fixtures Folder for Service autoconfiguration**

Depending on where you want to create your Fixtures or if they should only be accessible during test execution.

```yaml
when@test:
services:
App\Tests\Fixture\:
autoconfigure: true
resource: '../tests/Fixture/'
```
### Upgrading from earlier Version
Fixtures are now considered actual services and are loaded through Dependency Injection (DI).
Expand Down
2 changes: 1 addition & 1 deletion src/Locator/FixtureNotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class FixtureNotFound extends \OutOfBoundsException
public static function forFixtures(array $fixturesToLoad): self
{
return new self(\sprintf(
'Fixtures not found: "%s"',
'Fixtures not found: "%s". Maybe you forgot to register your Fixture as a Service?',
implode('", "', $fixturesToLoad),
));
}
Expand Down

0 comments on commit e589253

Please sign in to comment.