@@ -227,100 +227,3 @@ public static function warmup(): void
227227 // Esta é a vantagem da abordagem explícita
228228 }
229229}
230-
231- /**
232- * Mock Request para capturar responses estáticas
233- */
234- class MockRequest
235- {
236- /**
237- * @param mixed $default
238- * @return mixed
239- */
240- public function param (string $ name , $ default = null )
241- {
242- return $ default ;
243- }
244-
245- /**
246- * @param mixed $default
247- * @return mixed
248- */
249- public function get (string $ name , $ default = null )
250- {
251- return $ default ;
252- }
253-
254- /**
255- * @param array<mixed> $args
256- * @return mixed
257- */
258- public function __call (string $ method , array $ args )
259- {
260- return null ;
261- }
262- }
263-
264- /**
265- * Mock Response para capturar responses estáticas
266- */
267- class MockResponse
268- {
269- private string $ content = '' ;
270- /** @var array<string, string> */
271- private array $ headers = [];
272- private int $ statusCode = 200 ;
273-
274- /**
275- * @param array<mixed> $data
276- */
277- public function json (array $ data ): self
278- {
279- $ json = json_encode ($ data );
280- $ this ->content = $ json !== false ? $ json : '' ;
281- $ this ->headers ['Content-Type ' ] = 'application/json ' ;
282- return $ this ;
283- }
284-
285- public function send (string $ content ): self
286- {
287- $ this ->content = $ content ;
288- return $ this ;
289- }
290-
291- public function write (string $ content ): self
292- {
293- $ this ->content .= $ content ;
294- return $ this ;
295- }
296-
297- public function withHeader (string $ name , string $ value ): self
298- {
299- $ this ->headers [$ name ] = $ value ;
300- return $ this ;
301- }
302-
303- public function status (int $ code ): self
304- {
305- $ this ->statusCode = $ code ;
306- return $ this ;
307- }
308-
309- public function getContent (): string
310- {
311- return $ this ->content ;
312- }
313-
314- /**
315- * @return array<string, string>
316- */
317- public function getHeaders (): array
318- {
319- return $ this ->headers ;
320- }
321-
322- public function getStatusCode (): int
323- {
324- return $ this ->statusCode ;
325- }
326- }
0 commit comments