Skip to content

Commit 412a94b

Browse files
committed
[PhpUnitBridge] Add strtotime() to ClockMock
1 parent a1b2446 commit 412a94b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

components/phpunit_bridge.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,13 @@ Clock Mocking
566566

567567
The :class:`Symfony\\Bridge\\PhpUnit\\ClockMock` class provided by this bridge
568568
allows you to mock the PHP's built-in time functions ``time()``, ``microtime()``,
569-
``sleep()``, ``usleep()``, ``gmdate()``, and ``hrtime()``. Additionally the
570-
function ``date()`` is mocked so it uses the mocked time if no timestamp is
571-
specified.
569+
``sleep()``, ``usleep()``, ``gmdate()``, ``hrtime()``, and ``strtotime()``.
570+
Additionally the function ``date()`` is mocked so it uses the mocked time if no
571+
timestamp is specified.
572+
573+
.. versionadded:: 7.4
574+
575+
Support for mocking the ``strtotime()`` function was introduced in Symfony 7.4.
572576

573577
Other functions with an optional timestamp parameter that defaults to ``time()``
574578
will still use the system time instead of the mocked time. This means that you

0 commit comments

Comments
 (0)