zenstruck / messenger-test

Assertions and helpers for testing your symfony/messenger queues.
MIT License
218 stars 15 forks source link

fix: allows to use options configuration #80

Closed aegypius closed 3 months ago

aegypius commented 3 months ago

Fixes #79

nikophil commented 3 months ago

@kbond don't you think we could make methods TestTransport::isIntercepting(), isCatchingExceptions() and so on public? this way we could test this PR

kbond commented 3 months ago

don't you think we could make methods TestTransport::isIntercepting(), isCatchingExceptions() and so on public?

I don't have a problem with this.

aegypius commented 3 months ago

@aegypius, could you fix the deprecations in TestTransportFactoryTest?

Working on it

aegypius commented 3 months ago

Should not self::$supportDelayStamp be resetted too ? https://github.com/aegypius/messenger-test/blob/allows-options-based-configuration/src/Transport/TestTransport.php#L337

kbond commented 3 months ago

Should not self::$supportDelayStamp be resetted too

I'm thinking yes but @nikophil, can you confirm?

nikophil commented 3 months ago

not sure this is needed:

TestTransport::resetAll() is called in a #[After] hook in order to reset everything in TestTransport that could have changed in the test execution: including all different states ($queued, $rejected...) but also $intercept and $catchExceptions which can be modified by methods catchExceptions()/throwExceptions() and unblock()/intercept()

Since we're not allowing $supportDelayStamp to be modified (and we should not do this: this behavior will be the default one in a further major version, and could not be disabled), it is not needed to reset it

kbond commented 3 months ago

not sure this is needed:

Ok, let's leave as is for now.

kbond commented 3 months ago

Thank you @aegypius!