File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -176,4 +176,23 @@ public function testSmallTimerInterval()
176176
177177 $ loop ->run ();
178178 }
179+
180+ /**
181+ * https://github.com/reactphp/event-loop/issues/19
182+ *
183+ * Tests that timer with PHP_INT_MAX seconds interval will work.
184+ */
185+ public function testIntOverflowTimerInterval ()
186+ {
187+ /** @var StreamSelectLoop|\PHPUnit_Framework_MockObject_MockObject $loop */
188+ $ loop = $ this ->getMock ('React\EventLoop\StreamSelectLoop ' , ['sleep ' ]);
189+ $ loop ->expects ($ this ->once ())
190+ ->method ('sleep ' )
191+ ->with (PHP_INT_MAX , 0 )
192+ ->willReturnCallback (function () use (&$ loop ) {
193+ $ loop ->stop ();
194+ });
195+ $ loop ->addTimer (PHP_INT_MAX , function (){});
196+ $ loop ->run ();
197+ }
179198}
You can’t perform that action at this time.
0 commit comments