File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ final class Timers
21
21
22
22
public function updateTime ()
23
23
{
24
- return $ this ->time = microtime (true );
24
+ return $ this ->time = \ microtime (true );
25
25
}
26
26
27
27
public function getTime ()
Original file line number Diff line number Diff line change 2
2
3
3
namespace React \Tests \EventLoop \Timer ;
4
4
5
+ use React \EventLoop \TimerInterface ;
5
6
use React \Tests \EventLoop \TestCase ;
6
7
use React \EventLoop \Timer \Timer ;
7
8
use React \EventLoop \Timer \Timers ;
@@ -24,4 +25,19 @@ public function testBlockedTimer()
24
25
25
26
$ this ->assertTrue (true );
26
27
}
28
+
29
+ public function testContains ()
30
+ {
31
+ $ timers = new Timers ();
32
+
33
+ /** @var TimerInterface $timer1 */
34
+ $ timer1 = $ this ->createMock ('React\EventLoop\TimerInterface ' );
35
+ /** @var TimerInterface $timer2 */
36
+ $ timer2 = $ this ->createMock ('React\EventLoop\TimerInterface ' );
37
+
38
+ $ timers ->add ($ timer1 );
39
+
40
+ self ::assertTrue ($ timers ->contains ($ timer1 ));
41
+ self ::assertFalse ($ timers ->contains ($ timer2 ));
42
+ }
27
43
}
You can’t perform that action at this time.
0 commit comments