You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, something like Laravel's flush() method.
Through tearDown(), this flushes the container so each test starts with a fresh set of container definitions and aren't reused in between tests. This has the benefit of resetting all mocked instances in the container.
Right now with di52, we have to actively think about how singleton definitions will affect other tests, for example if a definition is defined to use a singleton, and an early test registers a Mock in the container, then other tests down the road will use that same mock instance instead when getting the instance out of the container.
Note: I'm not 100% sure if this a problem with slic/codeception potentially running all the tests using the same process.
The only way to manually do this right now as far as I know is using offsetUnset(), and you need to know all the IDs ahead of time.
The text was updated successfully, but these errors were encountered:
For example, something like Laravel's flush() method.
Through tearDown(), this flushes the container so each test starts with a fresh set of container definitions and aren't reused in between tests. This has the benefit of resetting all mocked instances in the container.
Right now with di52, we have to actively think about how
singleton
definitions will affect other tests, for example if a definition is defined to use a singleton, and an early test registers a Mock in the container, then other tests down the road will use that same mock instance instead when getting the instance out of the container.The only way to manually do this right now as far as I know is using offsetUnset(), and you need to know all the IDs ahead of time.
The text was updated successfully, but these errors were encountered: