@@ -23,9 +23,8 @@ class CookieClientTest extends TestCase
23
23
*
24
24
* @throws ClientExceptionInterface
25
25
*/
26
- public function testSetToStorage (bool $ secure , string $ host , string $ path )
26
+ public function testSetToStorage (bool $ secure , string $ host , string $ path ): void
27
27
{
28
-
29
28
$ storage = new Storage ();
30
29
31
30
$ client = new CookieClientDecorator (new FakeHttpClient (new Handler ()), $ storage );
@@ -57,13 +56,13 @@ public function testSetToStorage(bool $secure, string $host, string $path)
57
56
58
57
/**
59
58
* @param string $uri
60
- * @param array $expected
59
+ * @param array<string, string> $expected
61
60
*
62
61
* @dataProvider provideGetFromStorage
63
62
*
64
63
* @throws ClientExceptionInterface
65
64
*/
66
- public function testGetFromStorage (string $ uri , array $ expected )
65
+ public function testGetFromStorage (string $ uri , array $ expected ): void
67
66
{
68
67
$ set = [
69
68
[
@@ -134,11 +133,12 @@ public function testGetFromStorage(string $uri, array $expected)
134
133
$ request = new Request ('GET ' , $ uri , ['Accept ' => 'text/plain ' ]);
135
134
$ response = $ client ->sendRequest ($ request );
136
135
$ json = $ response ->getBody ()->__toString ();
136
+ /** @var array<string, string> $cookies */
137
137
$ cookies = json_decode ($ json , true );
138
138
$ this ->assertCount (count ($ expected ), $ cookies );
139
139
foreach ($ expected as $ name => $ value ) {
140
140
$ this ->assertArrayHasKey ($ name , $ cookies );
141
- $ this ->assertSame ($ value , $ cookies [$ name ]);
141
+ $ this ->assertSame ($ value , $ cookies [$ name ] ?? null );
142
142
}
143
143
}
144
144
@@ -150,6 +150,9 @@ public function provideSetToStorage(): array
150
150
];
151
151
}
152
152
153
+ /**
154
+ * @return array{0: string, 1: array<string, string>}[]
155
+ */
153
156
public function provideGetFromStorage (): array
154
157
{
155
158
return [
@@ -169,7 +172,7 @@ private function assertStoredCookie(
169
172
string $ path ,
170
173
bool $ secure ,
171
174
bool $ temporary
172
- ) {
175
+ ): void {
173
176
$ this ->assertSame ($ value , $ cookie ['value ' ]);
174
177
$ this ->assertSame ($ domain , $ cookie ['domain ' ]);
175
178
$ this ->assertSame ($ path , $ cookie ['path ' ]);
0 commit comments