-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to replace the DateTimeImmutable class on mocked datetime #123
Comments
At the moment we came to the conclusion that we can use another solution for this case - php-timecop But I think that it would be good if there was an opportunity to change used classes or to set datetime value from the outside. |
In the pdo-event-store-projector there are several places like: acquireLock, updateLock, persist where "NOW" is hardcoded. All those methods are private, so you are unable to inject anything to it. I can't see any benefit to allow changing the used class name (f.e. to Carbon). Being able to change those values from the outside is a really bad idea IMHO, as it would poise the interface with optional arguments, that you are not supposed to pass in. The only place where you would be interested in this is during unit or integration tests, not for real production usage. So my advice would be:
|
@prolic thank you for feedback. For now, we are OK with https://github.com/hnw/php-timecop for testing purpose so you may close this issue. |
pdo-event-store/src/Projection/PdoEventStoreProjector.php
Line 805 in 66d11ab
This discussion was started in Gitter and continues in this issue.
The text was updated successfully, but these errors were encountered: