Skip to content

Commit 8e18cc7

Browse files
committed
minor #17368 Correct time type return (fullbl)
This PR was submitted for the 6.1 branch but it was merged into the 4.4 branch instead. Discussion ---------- Correct time type return time function returns an int, while DateTime::createFromFormat requires a string! <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- 43e7043 Correct time type return
2 parents 5ece334 + 43e7043 commit 8e18cc7

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)