File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -940,6 +940,28 @@ public function testTheRequestSendingAndResponseReceivedEventsAreFiredWhenAReque
940
940
m::close ();
941
941
}
942
942
943
+ public function testTheRequestSendingAndResponseReceivedEventsAreFiredWhenARequestIsSentAsync ()
944
+ {
945
+ $ events = m::mock (Dispatcher::class);
946
+ $ events ->shouldReceive ('dispatch ' )->times (5 )->with (m::type (RequestSending::class));
947
+ $ events ->shouldReceive ('dispatch ' )->times (5 )->with (m::type (ResponseReceived::class));
948
+
949
+ $ factory = new Factory ($ events );
950
+ $ factory ->fake ();
951
+ $ factory ->pool (function (Pool $ pool ) {
952
+ return [
953
+ $ pool ->get ('https://example.com ' ),
954
+ $ pool ->head ('https://example.com ' ),
955
+ $ pool ->post ('https://example.com ' ),
956
+ $ pool ->patch ('https://example.com ' ),
957
+ $ pool ->delete ('https://example.com ' ),
958
+ ];
959
+ });
960
+
961
+
962
+ m::close ();
963
+ }
964
+
943
965
public function testTheTransferStatsAreCalledSafelyWhenFakingTheRequest ()
944
966
{
945
967
$ this ->factory ->fake (['https://example.com ' => ['world ' => 'Hello world ' ]]);
You can’t perform that action at this time.
0 commit comments