Skip to content

Commit 43e7043

Browse files
fullbljaviereguiluz
authored andcommitted
Correct time type return
time function returns an int, while DateTime::createFromFormat requires a string!
1 parent 5ece334 commit 43e7043

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/phpunit_bridge.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ is mocked so it uses the mocked time if no timestamp is specified.
500500
Other functions with an optional timestamp parameter that defaults to ``time()``
501501
will still use the system time instead of the mocked time. This means that you
502502
may need to change some code in your tests. For example, instead of ``new DateTime()``,
503-
you should use ``DateTime::createFromFormat('U', time())`` to use the mocked
503+
you should use ``DateTime::createFromFormat('U', (string) time())`` to use the mocked
504504
``time()`` function.
505505

506506
To use the ``ClockMock`` class in your test, add the ``@group time-sensitive``

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy