Open fhusquinet opened 4 years ago
@fhusquinet can you share a repo that I can test with?
For sure, here is a basic Laravel installation with all the packages integrated into my project (which isn't too many as of now): https://github.com/fhusquinet/test-multi-tenant-event-sourcing-integration
Running the unit test file should work because it is using PHPUnit's base TestCase file and not the one provided by Laravel. The feature test file will throw that error on the second test and the ones after.
Hi!
I have a weird issue when using this package with spatie/laravel-event-sourcing. When I am running tests with PHPUnit everything fails after the first test.
Illuminate\Contracts\Container\BindingResolutionException: Unresolvable dependency resolving [Parameter #0 [ string $storedEventRepository ]] in class Spatie\EventSourcing\EventSubscriber
Looks like the singleton binding for the EventSubscriber isn't used/ran after the first test is run. The class doesn't receive the required $storedEventRepository parameter when created, which should contain the value in the config file (config('event-sourcing.stored_event_repository')).
If I hardcode a fallback inside the class the tests run, but this isn't a viable option obviously...
My test isn't related to any functionnality provided by either of the two packages.
I know this is most likely not an issue with this package in particular, nor with spatie/laravel-event-sourcing but maybe a functionality that is used by both packages and therefore creates a conflict?
Hoping you have an idea of where this could come from, because I'm shooting dd() in the dark right now 😅
Happy holidays!