Level 73
This might shed some light on the subject
https://stackoverflow.com/questions/59304228/how-to-mock-date-in-php-unit-test
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Is there a simple way to set the server time before the tests? I have written some tests for a booking system and everything is depending on times and dates. Now it would be great to have the option to set the server time before running the test. What would be the simplest way to achieve this?
Please or to participate in this conversation.