Skip to content

Commit c4d3e5d

Browse files
committed
minor #8314 Update phpunit_bridge.rst (temenb, javiereguiluz)
This PR was submitted for the 3.3 branch but it was merged into the 2.8 branch instead (closes #8314). Discussion ---------- Update phpunit_bridge.rst $stopwatch->stop('event_name')->getDuration() returns time in milliseconds, so original test will fail in any way.. but not only because of "However, depending on the load of the server or the processes running on your local machine, the $duration could for example be 10.000023s instead of 10s." Commits ------- 47460b5 Fixed a minor syntax issue afbbfd5 Update phpunit_bridge.rst
2 parents 3a41ea8 + 47460b5 commit c4d3e5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/phpunit_bridge.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,14 @@ If you have this kind of time-related tests::
167167
sleep(10);
168168
$duration = $stopwatch->stop('event_name')->getDuration();
169169

170-
$this->assertEquals(10, $duration);
170+
$this->assertEquals(10000, $duration);
171171
}
172172
}
173173

174174
You used the :doc:`Symfony Stopwatch Component </components/stopwatch>` to
175175
calculate the duration time of your process, here 10 seconds. However, depending
176176
on the load of the server or the processes running on your local machine, the
177-
``$duration`` could for example be `10.000023s` instead of `10s`.
177+
``$duration`` could for example be ``10.000023s`` instead of ``10s``.
178178

179179
This kind of tests are called transient tests: they are failing randomly
180180
depending on spurious and external circumstances. They are often cause trouble

0 commit comments

Comments
 (0)