Skip to content

Commit

Permalink
Ensure compatibility with mongodb v2
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Oct 21, 2024
1 parent 35f7b4c commit 3f38426
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand All @@ -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');
Expand Down

0 comments on commit 3f38426

Please sign in to comment.