Open sidz opened 3 months ago
Hey @kbond, @nikophil,.
I've raised this pull request in order to speedup improvement discussed in https://github.com/zenstruck/messenger-test/pull/77#issuecomment-2060798321. But it seems like there are a couple of test cases which have been written to be sure that state is persisting between tests.
so my PR seems like a BC break.
But it seems like there are a couple of test cases which have been written to be sure that state is persisting between tests.
Not between tests but between kernel reboots within a single test. We need to keep this behaviour.
I think the crux of the issue is in tests NOT using InteractsWithMessenger
, we do want the transport reset on reboot.
hi @sidz
we should detect if the current test uses the trait InteractWithMessenger
(maybe by doing something similar than here)
And if we detect that the trait was used, we should do nothing in reset()
but it makes me think that this is also a BC break, because TestTransport::reset()
is a public method, which is documented... we should not change its behavior this way.... WDYT @kbond?
Implement Symfony\Contracts\Service\ResetInterface so TestTransport could be cleared automatically after each tearDown
Discussed in: https://github.com/zenstruck/messenger-test/pull/77#issuecomment-2060798321