From 3f38426b9447521b044fbee56a1b31b18e049042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Mon, 21 Oct 2024 21:59:03 +0200 Subject: [PATCH 1/2] Ensure compatibility with mongodb v2 --- Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php b/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php index 93c7995dd..b1c9db759 100644 --- a/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php +++ b/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php @@ -133,6 +133,8 @@ public function testWrite() $this->assertInstanceOf(\MongoDB\BSON\UTCDateTime::class, $data[$this->options['time_field']]); $this->assertInstanceOf(\MongoDB\BSON\UTCDateTime::class, $data[$this->options['expiry_field']]); $this->assertGreaterThanOrEqual($expectedExpiry, round((string) $data[$this->options['expiry_field']] / 1000)); + + return $this->createMock(\MongoDB\UpdateResult::class); }); $this->assertTrue($this->storage->write('foo', 'bar')); @@ -153,6 +155,8 @@ public function testReplaceSessionData() ->method('updateOne') ->willReturnCallback(function ($criteria, $updateData, $options) use (&$data) { $data = $updateData; + + return $this->createMock(\MongoDB\UpdateResult::class); }); $this->storage->write('foo', 'bar'); From 38bd9bc4f5de292ddbf860d02596133dbc09d422 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 25 Oct 2024 15:35:27 +0200 Subject: [PATCH 2/2] [HttpFoundation] Remove invalid HTTP method from exception message --- Request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Request.php b/Request.php index 561cb887f..31d11c5da 100644 --- a/Request.php +++ b/Request.php @@ -1294,7 +1294,7 @@ public function getMethod() } if (!preg_match('/^[A-Z]++$/D', $method)) { - throw new SuspiciousOperationException(sprintf('Invalid method override "%s".', $method)); + throw new SuspiciousOperationException('Invalid HTTP method override.'); } return $this->method = $method;