From 43e70430718b66b86c48aae9df22f724d5e4934a Mon Sep 17 00:00:00 2001 From: fullbl <8133457+fullbl@users.noreply.github.com> Date: Wed, 19 Oct 2022 12:56:17 +0200 Subject: [PATCH] Correct time type return time function returns an int, while DateTime::createFromFormat requires a string! --- components/phpunit_bridge.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/phpunit_bridge.rst b/components/phpunit_bridge.rst index 934c425d368..cb77a1e376f 100644 --- a/components/phpunit_bridge.rst +++ b/components/phpunit_bridge.rst @@ -500,7 +500,7 @@ is mocked so it uses the mocked time if no timestamp is specified. Other functions with an optional timestamp parameter that defaults to ``time()`` will still use the system time instead of the mocked time. This means that you may need to change some code in your tests. For example, instead of ``new DateTime()``, -you should use ``DateTime::createFromFormat('U', time())`` to use the mocked +you should use ``DateTime::createFromFormat('U', (string) time())`` to use the mocked ``time()`` function. To use the ``ClockMock`` class in your test, add the ``@group time-sensitive``