Skip to content

Commit 88f57c8

Browse files
committed
fixup! Allow to specify the cookie type for appframework responses
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
1 parent 71883c6 commit 88f57c8

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

tests/lib/AppFramework/Http/ResponseTest.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ public function testAddCookie() {
108108
'foo' => [
109109
'value' => 'bar',
110110
'expireDate' => null,
111+
'sameSite' => 'Lax',
111112
],
112113
'bar' => [
113114
'value' => 'foo',
114-
'expireDate' => new \DateTime('1970-01-01')
115+
'expireDate' => new \DateTime('1970-01-01'),
116+
'sameSite' => 'Lax',
115117
]
116118
];
117119
$this->assertEquals($expectedResponse, $this->childResponse->getCookies());
@@ -143,7 +145,8 @@ public function testInvalidateCookie() {
143145
$expected = [
144146
'foo' => [
145147
'value' => 'expired',
146-
'expireDate' => new \DateTime('1971-01-01')
148+
'expireDate' => new \DateTime('1971-01-01'),
149+
'sameSite' => 'Lax',
147150
]
148151
];
149152

@@ -159,11 +162,13 @@ public function testInvalidateCookies() {
159162
$expected = [
160163
'foo' => [
161164
'value' => 'bar',
162-
'expireDate' => null
165+
'expireDate' => null,
166+
'sameSite' => 'Lax',
163167
],
164168
'bar' => [
165169
'value' => 'foo',
166-
'expireDate' => null
170+
'expireDate' => null,
171+
'sameSite' => 'Lax',
167172
]
168173
];
169174
$cookies = $this->childResponse->getCookies();
@@ -173,11 +178,13 @@ public function testInvalidateCookies() {
173178
$expected = [
174179
'foo' => [
175180
'value' => 'expired',
176-
'expireDate' => new \DateTime('1971-01-01')
181+
'expireDate' => new \DateTime('1971-01-01'),
182+
'sameSite' => 'Lax',
177183
],
178184
'bar' => [
179185
'value' => 'expired',
180-
'expireDate' => new \DateTime('1971-01-01')
186+
'expireDate' => new \DateTime('1971-01-01'),
187+
'sameSite' => 'Lax',
181188
]
182189
];
183190

0 commit comments

Comments
 (0)