File tree 2 files changed +5
-0
lines changed
2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,8 @@ public function connect($uri)
159
159
// either close active connection or cancel pending connection attempt
160
160
$ connecting ->then (function (ConnectionInterface $ stream ) {
161
161
$ stream ->close ();
162
+ }, function () {
163
+ // ignore to avoid reporting unhandled rejection
162
164
});
163
165
$ connecting ->cancel ();
164
166
});
Original file line number Diff line number Diff line change @@ -542,6 +542,9 @@ public function testRejectedConnectionShouldNotCreateGarbageCycles()
542
542
$ proxy = new ProxyConnector ('proxy.example.com ' , $ this ->connector );
543
543
544
544
$ promise = $ proxy ->connect ('google.com:80 ' );
545
+
546
+ $ promise ->then (null , $ this ->expectCallableOnce ()); // avoid reporting unhandled rejection
547
+
545
548
unset($ promise );
546
549
547
550
$ this ->assertEquals (0 , gc_collect_cycles ());
You can’t perform that action at this time.
0 commit comments