I am looking for help in creating a complex test for our application based on the JSON API.
Short problem scenario:
- Check the creation of a temporary entity (for comparison)
- EntityManagerMock is configured to wait persist ($ temporEntity)
- Check real call method with some parameters
- Create an object and try to save
- The test fails because the change in time within 1 second

We tried to use ClockMock , but it only works for the class where / for the namespace was called. Our method is in a different namespace, and the entity is created in the following.
PHP \DateTime ClockMock / ( ). ClockMock Symfony, : -/.
- ? ( - get_declared_class() clockMock:: register - 15 000 : -/.
!