File tree 2 files changed +31
-0
lines changed
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -84,4 +84,26 @@ function it_returns_false_when_there_is_no_last_request()
84
84
{
85
85
$ this ->getLastRequest ()->shouldReturn (false );
86
86
}
87
+
88
+ function it_reset (
89
+ ResponseFactory $ responseFactory ,
90
+ RequestInterface $ request ,
91
+ ResponseInterface $ response ,
92
+ ResponseInterface $ newResponse
93
+ ) {
94
+ $ this ->addResponse ($ response );
95
+ $ this ->setDefaultResponse ($ response );
96
+ $ this ->addException (new \Exception ());
97
+ $ this ->setDefaultException (new \Exception ());
98
+
99
+ $ responseFactory ->createResponse ()->willReturn ($ newResponse );
100
+
101
+ $ this ->reset ();
102
+
103
+ $ this ->sendRequest ($ request )->shouldReturn ($ newResponse );
104
+
105
+ $ this ->reset ();
106
+
107
+ $ this ->getRequests ()->shouldReturn ([]);
108
+ }
87
109
}
Original file line number Diff line number Diff line change @@ -135,4 +135,13 @@ public function getLastRequest()
135
135
{
136
136
return end ($ this ->requests );
137
137
}
138
+
139
+ public function reset ()
140
+ {
141
+ $ this ->responses = [];
142
+ $ this ->exceptions = [];
143
+ $ this ->requests = [];
144
+ $ this ->setDefaultException ();
145
+ $ this ->setDefaultResponse ();
146
+ }
138
147
}
You can’t perform that action at this time.
0 commit comments