Skip to content

Commit 574240d

Browse files
committed
Changed class elements order
1 parent 5028d57 commit 574240d

File tree

2 files changed

+41
-41
lines changed

2 files changed

+41
-41
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"psr/http-server-middleware": "^1.0"
1818
},
1919
"require-dev": {
20-
"polymorphine/dev": "0.5.*"
20+
"polymorphine/dev": "0.6.*"
2121
},
2222
"autoload": {
2323
"psr-4": {

tests/HeadersContextCookieTest.php

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,46 +23,6 @@
2323

2424
class HeadersContextCookieTest extends TestCase
2525
{
26-
public static function cookieData(): iterable
27-
{
28-
return [
29-
['myCookie=; Path=/; Expires=Thursday, 01-Jan-1970 00:00:00 UTC; MaxAge=-1525132800', [
30-
'name' => 'myCookie',
31-
'value' => null
32-
]],
33-
['fullCookie=foo; Domain=example.com; Path=/directory/; Expires=Tuesday, 01-May-2018 01:00:00 UTC; MaxAge=3600; Secure; HttpOnly; SameSite=Lax', [
34-
'name' => 'fullCookie',
35-
'value' => 'foo',
36-
'Secure' => true,
37-
'MaxAge' => 3600,
38-
'HttpOnly' => true,
39-
'Domain' => 'example.com',
40-
'Path' => '/directory/',
41-
'SameSite' => 'Lax'
42-
]],
43-
['fullCookie=foo; Domain=example.com; Path=/directory/; Expires=Tuesday, 01-May-2018 01:00:00 UTC; MaxAge=3600; Secure; HttpOnly; SameSite=Lax', [
44-
'name' => 'fullCookie',
45-
'value' => 'foo',
46-
'Secure' => true,
47-
'Expires' => FixedDateTime::withOffset(3600),
48-
'HttpOnly' => true,
49-
'Domain' => 'example.com',
50-
'Path' => '/directory/',
51-
'SameSite' => 'Lax'
52-
]]
53-
];
54-
}
55-
56-
public static function invalidNames(): iterable
57-
{
58-
return [['foo=bar'], ['żółty'], ['foo{bar}']];
59-
}
60-
61-
public static function invalidValues(): iterable
62-
{
63-
return [['foo\bar'], ['żółty'], ['foo;bar']];
64-
}
65-
6626
public function test_Instantiation()
6727
{
6828
$this->assertInstanceOf(CookieSetup::class, $setup = $this->cookieSetup());
@@ -188,6 +148,46 @@ public function test_GivenCookieWasSent_SendCookie_ThrowsException()
188148
$cookie->send('value');
189149
}
190150

151+
public static function cookieData(): iterable
152+
{
153+
return [
154+
['myCookie=; Path=/; Expires=Thursday, 01-Jan-1970 00:00:00 UTC; MaxAge=-1525132800', [
155+
'name' => 'myCookie',
156+
'value' => null
157+
]],
158+
['fullCookie=foo; Domain=example.com; Path=/directory/; Expires=Tuesday, 01-May-2018 01:00:00 UTC; MaxAge=3600; Secure; HttpOnly; SameSite=Lax', [
159+
'name' => 'fullCookie',
160+
'value' => 'foo',
161+
'Secure' => true,
162+
'MaxAge' => 3600,
163+
'HttpOnly' => true,
164+
'Domain' => 'example.com',
165+
'Path' => '/directory/',
166+
'SameSite' => 'Lax'
167+
]],
168+
['fullCookie=foo; Domain=example.com; Path=/directory/; Expires=Tuesday, 01-May-2018 01:00:00 UTC; MaxAge=3600; Secure; HttpOnly; SameSite=Lax', [
169+
'name' => 'fullCookie',
170+
'value' => 'foo',
171+
'Secure' => true,
172+
'Expires' => FixedDateTime::withOffset(3600),
173+
'HttpOnly' => true,
174+
'Domain' => 'example.com',
175+
'Path' => '/directory/',
176+
'SameSite' => 'Lax'
177+
]]
178+
];
179+
}
180+
181+
public static function invalidNames(): iterable
182+
{
183+
return [['foo=bar'], ['żółty'], ['foo{bar}']];
184+
}
185+
186+
public static function invalidValues(): iterable
187+
{
188+
return [['foo\bar'], ['żółty'], ['foo;bar']];
189+
}
190+
191191
private function cookieSetup(?ResponseHeaders &$context = null): CookieSetup
192192
{
193193
return new CookieSetup($context ??= new ResponseHeaders());

0 commit comments

Comments
 (0)