Skip to content

Commit 0220d41

Browse files
committed
Minor reword
1 parent a1632d7 commit 0220d41

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

components/clock.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -151,20 +151,20 @@ being in a month or another.
151151
Writing Time-Sensitive Tests
152152
----------------------------
153153

154-
The Clock component provides another trait, this one easing you the writing of time-sensitive
155-
tests: the :class:`Symfony\\Component\\Clock\\Test\\ClockSensitiveTrait`. The purpose
156-
of this trait is to provide methods to freeze time and restore the global clock after
157-
each test.
154+
The Clock component provides another trait, called :class:`Symfony\\Component\\Clock\\Test\\ClockSensitiveTrait`,
155+
to help you write time-sensitive tests. This trait provides methods to freeze
156+
time and restore the global clock after each test.
158157

159-
To interact with the mocked clock in your tests, you will have to use the ``ClockSensitiveTrait::mockTime()``
160-
method. This method accepts many types as its only argument:
158+
Use the ``ClockSensitiveTrait::mockTime()`` method to interact with the mocked
159+
clock in your tests. This method accepts different types as its only argument:
161160

162-
* A string, which can be a date or an interval. Examples: ``1996-07-01`` or ``+2 days``
163-
* A ``DateTimeImmutable`` to set the clock at
164-
* A boolean, to freeze or restore the global clock
161+
* A string, which can be a date to set the clock at (e.g. ``1996-07-01``) or an
162+
interval to modify the clock (e.g. ``+2 days``);
163+
* A ``DateTimeImmutable`` to set the clock at;
164+
* A boolean, to freeze or restore the global clock.
165165

166-
Let's say you want to test the method ``MonthSensitive::isWinterMonth()`` of the above example.
167-
An approach of the test class could be written this way::
166+
Let's say you want to test the method ``MonthSensitive::isWinterMonth()`` of the
167+
above example. This is how you can write that test::
168168

169169
namespace App\Tests\TimeUtils;
170170

@@ -197,10 +197,10 @@ An approach of the test class could be written this way::
197197
}
198198
}
199199

200-
It doesn't matter which time of the year you are running this test, it will always behave
201-
the same way. By combining the :class:`Symfony\\Component\\Clock\\ClockAwareTrait` and
202-
:class:`Symfony\\Component\\Clock\\Test\\ClockSensitiveTrait`, you have full control on
203-
your time-sensitive code's behavior.
200+
This test will behave the same no matter which time of the year you run it.
201+
By combining the :class:`Symfony\\Component\\Clock\\ClockAwareTrait` and
202+
:class:`Symfony\\Component\\Clock\\Test\\ClockSensitiveTrait`, you have full
203+
control on your time-sensitive code's behavior.
204204

205205
.. versionadded:: 6.3
206206

0 commit comments

Comments
 (0)