Skip to content

Commit c340fe4

Browse files
committed
minor #21066 [PHPUnitBridge] Add strtotime() to ClockMock (alamirault)
This PR was merged into the 7.4 branch. Discussion ---------- [PHPUnitBridge] Add `strtotime()` to ClockMock Fix #21056 Commits ------- 412a94b [PhpUnitBridge] Add strtotime() to ClockMock
2 parents 8cfa7b1 + 412a94b commit c340fe4

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)