@@ -167,7 +167,9 @@ public function testExecAfterPreviousFactoryRejectsUnderlyingDatabaseWillCreateN
167
167
new Promise (function () { })
168
168
);
169
169
170
- $ this ->db ->exec ('CREATE ' );
170
+ $ promise = $ this ->db ->exec ('CREATE ' );
171
+ $ promise ->then (null , $ this ->expectCallableOnce ()); // avoid reporting unhandled rejection
172
+
171
173
$ deferred ->reject ($ error );
172
174
173
175
$ this ->db ->exec ('CREATE ' );
@@ -392,9 +394,11 @@ public function testQueryAfterPreviousFactoryRejectsUnderlyingDatabaseWillCreate
392
394
$ this ->factory ->expects ($ this ->exactly (2 ))->method ('open ' )->willReturnOnConsecutiveCalls (
393
395
$ deferred ->promise (),
394
396
new Promise (function () { })
395
- );
397
+ );
398
+
399
+ $ promise = $ this ->db ->query ('CREATE ' );
400
+ $ promise ->then (null , $ this ->expectCallableOnce ()); // avoid reporting unhandled rejection
396
401
397
- $ this ->db ->query ('CREATE ' );
398
402
$ deferred ->reject ($ error );
399
403
400
404
$ this ->db ->query ('CREATE ' );
@@ -408,7 +412,7 @@ public function testQueryAfterPreviousUnderlyingDatabaseAlreadyClosedWillCreateN
408
412
$ this ->factory ->expects ($ this ->exactly (2 ))->method ('open ' )->willReturnOnConsecutiveCalls (
409
413
\React \Promise \resolve ($ client ),
410
414
new Promise (function () { })
411
- );
415
+ );
412
416
413
417
$ this ->db ->query ('CREATE ' );
414
418
$ client ->emit ('close ' );
@@ -433,7 +437,7 @@ public function testQueryAfterQueryWillNotStartIdleTimerWhenFirstQueryResolves()
433
437
$ client ->expects ($ this ->exactly (2 ))->method ('query ' )->willReturnOnConsecutiveCalls (
434
438
$ deferred ->promise (),
435
439
new Promise (function () { })
436
- );
440
+ );
437
441
438
442
$ this ->factory ->expects ($ this ->once ())->method ('open ' )->willReturn (\React \Promise \resolve ($ client ));
439
443
@@ -451,7 +455,7 @@ public function testQueryAfterQueryWillStartAndCancelIdleTimerWhenSecondQuerySta
451
455
$ client ->expects ($ this ->exactly (2 ))->method ('query ' )->willReturnOnConsecutiveCalls (
452
456
$ deferred ->promise (),
453
457
new Promise (function () { })
454
- );
458
+ );
455
459
456
460
$ this ->factory ->expects ($ this ->once ())->method ('open ' )->willReturn (\React \Promise \resolve ($ client ));
457
461
@@ -524,7 +528,9 @@ public function testCloseAfterExecWillEmitCloseWithoutErrorWhenUnderlyingDatabas
524
528
$ this ->db ->on ('error ' , $ this ->expectCallableNever ());
525
529
$ this ->db ->on ('close ' , $ this ->expectCallableOnce ());
526
530
527
- $ this ->db ->exec ('CREATE ' );
531
+ $ promise = $ this ->db ->exec ('CREATE ' );
532
+ $ promise ->then (null , $ this ->expectCallableOnce ()); // avoid reporting unhandled rejection
533
+
528
534
$ this ->db ->close ();
529
535
}
530
536
0 commit comments