@@ -27,6 +27,11 @@ public function tearDown()
2727 */
2828 public function testApiGetActualLoop_ReturnsLoopPassedInConstructor ()
2929 {
30+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
31+ {
32+ return $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
33+ }
34+
3035 $ loop = $ this ->createLoopMock ();
3136 $ react = new ReactLoop ($ loop );
3237 $ this ->assertSame ($ loop , $ react ->getActualLoop ());
@@ -37,6 +42,11 @@ public function testApiGetActualLoop_ReturnsLoopPassedInConstructor()
3742 */
3843 public function testApiAddReadStream_PassesProperParameters ()
3944 {
45+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
46+ {
47+ return $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
48+ }
49+
4050 $ stream = $ this ->createMemoryStream ();
4151 $ listener = $ this ->createCallableMock ();
4252
@@ -56,6 +66,11 @@ function($passedStream, $passedListener) use($stream, $listener) {
5666 */
5767 public function testApiAddWriteStream_PassesProperParameters ()
5868 {
69+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
70+ {
71+ return $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
72+ }
73+
5974 $ stream = $ this ->createMemoryStream ();
6075 $ listener = $ this ->createCallableMock ();
6176
@@ -75,6 +90,11 @@ function($passedStream, $passedListener) use($stream, $listener) {
7590 */
7691 public function testApiRemoveReadStream_PassesProperParameters ()
7792 {
93+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
94+ {
95+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
96+ }
97+
7898 $ stream = $ this ->createMemoryStream ();
7999
80100 $ react = $ this ->createApiMethodMock (
@@ -92,6 +112,11 @@ function($passedStream) use($stream) {
92112 */
93113 public function testApiRemoveWriteStream_PassesProperParameters ()
94114 {
115+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
116+ {
117+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
118+ }
119+
95120 $ stream = $ this ->createMemoryStream ();
96121
97122 $ react = $ this ->createApiMethodMock (
@@ -109,6 +134,11 @@ function($passedStream) use($stream) {
109134 */
110135 public function testApiRemoveStream_PassesProperParameters ()
111136 {
137+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
138+ {
139+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
140+ }
141+
112142 $ stream = $ this ->createMemoryStream ();
113143
114144 $ react = $ this ->createApiMethodMock (
@@ -126,6 +156,11 @@ function($passedStream) use($stream) {
126156 */
127157 public function testApiAddTimer_PassesProperParameters ()
128158 {
159+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
160+ {
161+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
162+ }
163+
129164 $ interval = 5e-1 ;
130165 $ callback = $ this ->createCallableMock ();
131166
@@ -148,6 +183,11 @@ function($passedInterval, $passedCallback) use($interval, $callback) {
148183 */
149184 public function testApiAddTimer_ReturnsReactTimer ()
150185 {
186+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
187+ {
188+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
189+ }
190+
151191 $ interval = 5e-1 ;
152192 $ callback = $ this ->createCallableMock ();
153193
@@ -171,6 +211,11 @@ function($interval, $callback) {
171211 */
172212 public function testApiAddPeriodicTimer_PassesProperParameters ()
173213 {
214+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
215+ {
216+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
217+ }
218+
174219 $ interval = 5e-1 ;
175220 $ callback = $ this ->createCallableMock ();
176221
@@ -193,6 +238,11 @@ function($passedInterval, $passedCallback) use($interval, $callback) {
193238 */
194239 public function testApiAddPeriodicTimer_ReturnsReactTimer ()
195240 {
241+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
242+ {
243+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
244+ }
245+
196246 $ interval = 5e-1 ;
197247 $ callback = $ this ->createCallableMock ();
198248
@@ -216,6 +266,11 @@ function($interval, $callback) {
216266 */
217267 public function testCancelTimer_CallsActualCancelTimer ()
218268 {
269+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
270+ {
271+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
272+ }
273+
219274 $ mockedTimer = $ this ->getMock (
220275 \Dazzle \Loop \Timer \TimerInterface::class
221276 );
@@ -244,6 +299,11 @@ function($passedTimer) use($mockedTimer) {
244299 */
245300 public function testApiIsTimerActive_CallsActualIsTimerActive ()
246301 {
302+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
303+ {
304+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
305+ }
306+
247307 $ mockedTimer = $ this ->getMock (
248308 \Dazzle \Loop \Timer \TimerInterface::class
249309 );
@@ -272,6 +332,11 @@ function($passedTimer) use($mockedTimer) {
272332 */
273333 public function testApiNextTick_PassesProperParamters ()
274334 {
335+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
336+ {
337+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
338+ }
339+
275340 $ listener = $ this ->createCallableMock ();
276341
277342 $ react = $ this ->createApiMethodMock (
@@ -289,6 +354,11 @@ function($passedListener) use($listener) {
289354 */
290355 public function testApiFutureTick_PassesProperParamters ()
291356 {
357+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
358+ {
359+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
360+ }
361+
292362 $ listener = $ this ->createCallableMock ();
293363
294364 $ react = $ this ->createApiMethodMock (
@@ -306,6 +376,11 @@ function($passedListener) use($listener) {
306376 */
307377 public function testApiTick_NeverTicksLoop ()
308378 {
379+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
380+ {
381+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
382+ }
383+
309384 $ this ->markTestSkipped (
310385 'Seems there is a problem with PHPUnit 5.2 compatibility here. '
311386 );
@@ -325,6 +400,11 @@ public function testApiTick_NeverTicksLoop()
325400 */
326401 public function testApiRun_NeverRunsLoop ()
327402 {
403+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
404+ {
405+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
406+ }
407+
328408 $ this ->markTestSkipped (
329409 'Seems there is a problem with PHPUnit 5.2 compatibility here. '
330410 );
@@ -344,6 +424,11 @@ public function testApiRun_NeverRunsLoop()
344424 */
345425 public function testApiStop_NeverStopsLoop ()
346426 {
427+ if (!interface_exists ('React\EventLoop\LoopInterface ' ))
428+ {
429+ $ this ->markTestSkipped ('This test requires React\EventLoop instance to work ' );
430+ }
431+
347432 $ this ->markTestSkipped (
348433 'Seems there is a problem with PHPUnit 5.2 compatibility here. '
349434 );
0 commit comments