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
2121
2222 public function updateTime ()
2323 {
24- return $ this ->time = microtime (true );
24+ return $ this ->time = \ microtime (true );
2525 }
2626
2727 public function getTime ()
Original file line number Diff line number Diff line change 22
33namespace React \Tests \EventLoop \Timer ;
44
5+ use React \EventLoop \TimerInterface ;
56use React \Tests \EventLoop \TestCase ;
67use React \EventLoop \Timer \Timer ;
78use React \EventLoop \Timer \Timers ;
@@ -24,4 +25,19 @@ public function testBlockedTimer()
2425
2526 $ this ->assertTrue (true );
2627 }
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+ }
2743}
You can’t perform that action at this time.
0 commit comments