8000 Correct time type return · symfony/symfony-docs@43e7043 · GitHub
[go: up one dir, main page]

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)
0