Skip to content

Commit 0a16914

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: fix typo in PULL_REQUEST_TEMPLATE.md Allow to disable lock without defining a resource [HttpFoundation] Compare cookie with null value as empty string in ResponseCookieValueSame Fix deprecation notice when date argument is not nullable and null value is provided
2 parents 0292516 + 46b278f commit 0a16914

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Test/Constraint/ResponseCookieValueSame.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected function matches($response): bool
5454
return false;
5555
}
5656

57-
return $this->value === $cookie->getValue();
57+
return $this->value === (string) $cookie->getValue();
5858
}
5959

6060
/**

Tests/Test/Constraint/ResponseCookieValueSameTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,12 @@ public function testConstraint()
4141

4242
$this->fail();
4343
}
44+
45+
public function testCookieWithNullValueIsComparedAsEmptyString()
46+
{
47+
$response = new Response();
48+
$response->headers->setCookie(Cookie::create('foo', null, 0, '/path'));
49+
50+
$this->assertTrue((new ResponseCookieValueSame('foo', '', '/path'))->evaluate($response, '', true));
51+
}
4452
}

0 commit comments

Comments
 (0)