File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
src/Illuminate/Http/Client Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -267,6 +267,16 @@ public function preventStrayRequests($prevent = true)
267
267
return $ this ;
268
268
}
269
269
270
+ /**
271
+ * Determine if stray requests are being prevented.
272
+ *
273
+ * @return bool
274
+ */
275
+ public function preventingStrayRequests ()
276
+ {
277
+ return $ this ->preventStrayRequests ;
278
+ }
279
+
270
280
/**
271
281
* Indicate that an exception should not be thrown if any request is not faked.
272
282
*
Original file line number Diff line number Diff line change @@ -2907,6 +2907,15 @@ public function testItCanEnforceFaking()
2907
2907
$ this ->factory ->get ('https://laravel.com ' );
2908
2908
}
2909
2909
2910
+ public function testPreventingStrayRequests ()
2911
+ {
2912
+ $ this ->assertFalse ($ this ->factory ->preventingStrayRequests ());
2913
+
2914
+ $ this ->factory ->preventStrayRequests ();
2915
+
2916
+ $ this ->assertTrue ($ this ->factory ->preventingStrayRequests ());
2917
+ }
2918
+
2910
2919
public function testItCanAddAuthorizationHeaderIntoRequestUsingBeforeSendingCallback ()
2911
2920
{
2912
2921
$ this ->factory ->fake ();
You can’t perform that action at this time.
0 commit comments