|
| 1 | +<?php declare(strict_types = 1); |
| 2 | + |
| 3 | +namespace Fapi\FapiClientTests\MockHttpClients; |
| 4 | + |
| 5 | +use Fapi\HttpClient\HttpRequest; |
| 6 | +use Fapi\HttpClient\HttpResponse; |
| 7 | +use Fapi\HttpClient\MockHttpClient; |
| 8 | + |
| 9 | +final class FapiClientClientChangesMockHttpClient extends MockHttpClient |
| 10 | +{ |
| 11 | + |
| 12 | + public function __construct() |
| 13 | + { |
| 14 | + $this->add( |
| 15 | + new HttpRequest( |
| 16 | + 'GET', |
| 17 | + 'https://api.fapi.cz/client-changes/search?client=1810411&_action=created', |
| 18 | + [ |
| 19 | + 'Host' => ['api.fapi.cz'], |
| 20 | + 'verify' => ['1'], |
| 21 | + 'Content-Type' => ['application/json'], |
| 22 | + 'Accept' => ['application/json'], |
| 23 | + 'Authorization' => ['Basic c2xpc2Noa2FAdGVzdC1mYXBpLmN6OmpJQkFXbEt6ekI2clFWazVZM1QwVnhUZ24='], |
| 24 | + ], |
| 25 | + '', |
| 26 | + '1.1' |
| 27 | + ), |
| 28 | + new HttpResponse( |
| 29 | + 200, |
| 30 | + [ |
| 31 | + 'Date' => ['Thu, 18 Nov 2021 15:39:32 GMT'], |
| 32 | + 'Content-Type' => ['application/json'], |
| 33 | + 'Transfer-Encoding' => ['chunked'], |
| 34 | + 'Connection' => ['keep-alive'], |
| 35 | + 'Server' => ['nginx'], |
| 36 | + 'Vary' => ['Accept-Encoding'], |
| 37 | + 'X-Powered-By' => ['Nette Framework 3'], |
| 38 | + 'X-Frame-Options' => ['SAMEORIGIN', 'sameorigin'], |
| 39 | + 'Set-Cookie' => ['_nss=1; path=/; HttpOnly; SameSite=Strict'], |
| 40 | + 'Strict-Transport-Security' => ['max-age=63072000; includeSubDomains; preload'], |
| 41 | + 'X-Content-Type-Options' => ['nosniff'], |
| 42 | + 'X-Origin-Instance' => ['web1.prod.fapi.cloud'], |
| 43 | + 'Access-Control-Allow-Origin' => ['*'], |
| 44 | + 'Access-Control-Allow-Headers' => ['Origin, X-Requested-With, Content-Type, Accept'], |
| 45 | + 'x-encoded-content-encoding' => ['gzip'], |
| 46 | + ], |
| 47 | + '{"client_changes":[{"id":14404731,"client":1810411,"action":"created","date":"2020-09-10 10:14:58","changes":null,"user":{"id":5,"username":"admin@fapi.cz"}}]}' |
| 48 | + ) |
| 49 | + ); |
| 50 | + } |
| 51 | + |
| 52 | +} |
0 commit comments