Skip to content

Conversation

@pbromb
Copy link

@pbromb pbromb commented Dec 22, 2025

Summary

This pull request modernizes the MongoDB module and fixes CI issues caused by recent
changes in PHPUnit, PHP versions, and MongoDB tooling. It also adds support for the
latest major version of the MongoDB PHP driver.


Changes

PHPUnit compatibility

  • [BC BREAK] Removed usage of PHPUnit\Framework\TestCase::getGroups(), which was
    removed in recent PHPUnit versions.
  • Updated the module to work correctly with current PHPUnit releases.

MongoDB database tools

  • Added missing dependencies required by the mongodb-database-tools environment.
  • This fixes CI failures related to MongoDB dump/restore operations.

PHP version support

  • Added support for:
    • PHP 8.2
    • PHP 8.3
    • PHP 8.4
    • PHP 8.5

MongoDB PHP driver

  • Added support for mongodb/mongodb v2.x.
  • Ensures compatibility with the latest official MongoDB PHP library.

Motivation

The goal of this change is to:

  • Fix CI failures
  • Align the MongoDB module with currently supported PHP versions
  • Support the latest MongoDB PHP driver

Checklist

  • CI fixed and passing
  • PHPUnit compatibility updated
  • PHP support matrix updated
  • MongoDB driver v2 supported

{
$cmd = sprintf(
'mongo %s %s%s',
'mongosh %s %s%s',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #14 (comment) backwards-compatible solutions were discussed.

@pbromb Do you think that adding a new dump method for mongosh would be possible. It sounds easy to implement at first sight.

This way this PR could be part of a minor release since it wouldn't break BC.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@W0rma I've added automatic detection of whether mongosh or the legacy mongo shell is available in the environment.

With this approach, no existing behavior is broken, so the change should be safe to include in a minor release without introducing BC breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants