|
3 | 3 | declare(strict_types=1); |
4 | 4 |
|
5 | 5 | use GuzzleHttp\Psr7\HttpFactory; |
| 6 | +use GuzzleHttp\Psr7\Response; |
6 | 7 | use PHPUnit\Framework\TestCase; |
7 | 8 | use Psr\Http\Message\ResponseInterface; |
8 | 9 | use Psr\Log\LoggerInterface; |
@@ -44,34 +45,35 @@ public function testLogDeprecation(?string $expectedLogMessage, array $expectedC |
44 | 45 | */ |
45 | 46 | public static function dataProviderLogDeprecation(): array |
46 | 47 | { |
47 | | - $httpFactory = new HttpFactory(); |
48 | | - |
49 | 48 | return [ |
50 | | - [null, [], $httpFactory->createResponse()], |
| 49 | + [null, [], new Response()], |
51 | 50 | [ |
52 | 51 | 'Api: test method: GET uri: "https://test/" call is deprecated', |
53 | 52 | [ |
54 | 53 | 'Sunset' => '2022-12-15T21:46:37+00:00', |
55 | 54 | 'Link' => 'https://example.net/sunset', |
56 | 55 | 'Deprecated' => 'Some deprecated description', |
57 | 56 | ], |
58 | | - $httpFactory->createResponse() |
59 | | - ->withHeader('Sunset', 'Thu, 15 Dec 2022 21:46:37 GMT') |
60 | | - ->withHeader('Link', '<https://example.net/sunset>;rel="sunset";type="text/html"') |
61 | | - ->withHeader('Deprecated', 'Some deprecated description') |
62 | | - , |
| 57 | + new Response( |
| 58 | + headers: [ |
| 59 | + 'Sunset' => 'Thu, 15 Dec 2022 21:46:37 GMT', |
| 60 | + 'Link' => '<https://example.net/sunset>;rel="sunset";type="text/html"', |
| 61 | + 'Deprecated' => 'Some deprecated description', |
| 62 | + ], |
| 63 | + ), |
63 | 64 | ], |
64 | 65 | [ |
65 | 66 | 'Api: test method: GET uri: "https://test/" call is deprecated', |
66 | 67 | [ |
67 | 68 | 'Sunset' => 'Some sunset header with incorrect format', |
68 | 69 | 'Link' => 'Some sunset link with incorrect format', |
69 | 70 | ], |
70 | | - $httpFactory->createResponse() |
71 | | - ->withHeader('Sunset', 'Some sunset header with incorrect format') |
72 | | - ->withHeader('Link', 'Some another link') |
73 | | - ->withHeader('Link', 'Some sunset link with incorrect format') |
74 | | - , |
| 71 | + new Response( |
| 72 | + headers: [ |
| 73 | + 'Sunset' => 'Some sunset header with incorrect format', |
| 74 | + 'Link' => 'Some sunset link with incorrect format', |
| 75 | + ], |
| 76 | + ), |
75 | 77 | ], |
76 | 78 | ]; |
77 | 79 | } |
|
0 commit comments