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 @@ -149,6 +149,8 @@ public function fake($callback = null)
149
149
{
150
150
$ this ->record ();
151
151
152
+ $ this ->recorded = [];
153
+
152
154
if (is_null ($ callback )) {
153
155
$ callback = function () {
154
156
return static ::response ();
Original file line number Diff line number Diff line change @@ -180,6 +180,23 @@ public function testCanSendFormData()
180
180
});
181
181
}
182
182
183
+ public function testRecordedCallsAreEmptiedWhenFakeIsCalled ()
184
+ {
185
+ $ this ->factory ->fake ([
186
+ 'http://foo.com/* ' => ['page ' => 'foo ' ],
187
+ ]);
188
+
189
+ $ this ->factory ->get ('http://foo.com/test ' );
190
+
191
+ $ this ->factory ->assertSent (function (Request $ request ) {
192
+ return $ request ->url () === 'http://foo.com/test ' ;
193
+ });
194
+
195
+ $ this ->factory ->fake ();
196
+
197
+ $ this ->factory ->assertNothingSent ();
198
+ }
199
+
183
200
public function testSpecificRequestIsNotBeingSent ()
184
201
{
185
202
$ this ->factory ->fake ();
You can’t perform that action at this time.
0 commit comments