File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
tests/Symfony/Tests/Component/HttpKernel/Debug Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,10 @@ public function testTotalTime()
66
66
{
67
67
$ event = new StopwatchEvent (microtime (true ) * 1000 );
68
68
$ event ->start ();
69
- usleep (10000 );
69
+ usleep (20000 );
70
70
$ event ->stop ();
71
71
$ total = $ event ->getTotalTime ();
72
- $ this ->assertTrue ($ total >= 9 && $ total <= 20 );
72
+ $ this ->assertTrue ($ total > 10 && $ total <= 29 , $ total . ' should be 20 (between 10 and 29) ' );
73
73
74
74
$ event = new StopwatchEvent (microtime (true ) * 1000 );
75
75
$ event ->start ();
@@ -79,7 +79,7 @@ public function testTotalTime()
79
79
usleep (10000 );
80
80
$ event ->stop ();
81
81
$ total = $ event ->getTotalTime ();
82
- $ this ->assertTrue ($ total >= 18 && $ total <= 30 );
82
+ $ this ->assertTrue ($ total > 10 && $ total <= 29 , $ total . ' should be 20 (between 10 and 29) ' );
83
83
}
84
84
85
85
/**
@@ -101,7 +101,7 @@ public function testEnsureStopped()
101
101
usleep (10000 );
102
102
$ event ->ensureStopped ();
103
103
$ total = $ event ->getTotalTime ();
104
- $ this ->assertTrue ($ total >= 27 && $ total <= 40 );
104
+ $ this ->assertTrue ($ total >= 21 && $ total <= 39 , $ total . ' should be 30 (between 21 and 39) ' );
105
105
}
106
106
107
107
public function testStartTime ()
@@ -139,7 +139,7 @@ public function testEndTime()
139
139
usleep (10000 );
140
140
$ event ->stop ();
141
141
$ end = $ event ->getEndTime ();
142
- $ this ->assertTrue ($ end >= 18 && $ end <= 30 );
142
+ $ this ->assertTrue ($ end > 10 && $ end <= 29 , $ end . ' should be 20 (between 10 and 29) ' );
143
143
}
144
144
145
145
/**
Original file line number Diff line number Diff line change @@ -33,12 +33,12 @@ public function testStop()
33
33
{
34
34
$ stopwatch = new Stopwatch ();
35
35
$ stopwatch ->start ('foo ' , 'cat ' );
36
- usleep (10000 );
36
+ usleep (20000 );
37
37
$ event = $ stopwatch ->stop ('foo ' );
38
38
39
39
$ this ->assertInstanceof ('Symfony\Component\HttpKernel\Debug\StopwatchEvent ' , $ event );
40
40
$ total = $ event ->getTotalTime ();
41
- $ this ->assertTrue ($ total >= 9 && $ total <= 20 );
41
+ $ this ->assertTrue ($ total > 10 && $ total <= 29 , $ total . ' should be 20 (between 10 and 29) ' );
42
42
}
43
43
44
44
public function testLap ()
@@ -52,7 +52,7 @@ public function testLap()
52
52
53
53
$ this ->assertInstanceof ('Symfony\Component\HttpKernel\Debug\StopwatchEvent ' , $ event );
54
54
$ total = $ event ->getTotalTime ();
55
- $ this ->assertTrue ($ total >= 18 && $ total <= 30 );
55
+ $ this ->assertTrue ($ total > 10 && $ total <= 29 , $ total . ' should be 20 (between 10 and 29) ' );
56
56
}
57
57
58
58
/**
You can’t perform that action at this time.
0 commit comments