Skip to content

Remove tests that only ran on PHP 7 and clean up version-specific SKIPIFs#1986

Open
GromNaN wants to merge 1 commit intomongodb:v2.xfrom
GromNaN:cleanup-php7-skipif
Open

Remove tests that only ran on PHP 7 and clean up version-specific SKIPIFs#1986
GromNaN wants to merge 1 commit intomongodb:v2.xfrom
GromNaN:cleanup-php7-skipif

Conversation

@GromNaN
Copy link
Copy Markdown
Member

@GromNaN GromNaN commented Apr 13, 2026

PHP 8.1 is the minimum supported version since v1.17.

PHP 8.1 is the minimum supported version. Tests with
skip_if_php_version('>=', '7.99') are permanently skipped and can be
removed. Their PHP 8 counterparts (where applicable) remain in place.

Also remove the now-unnecessary skip_if_php_version('<', '7.99') from
session-startTransaction_error-005.phpt, which always runs on PHP 8.1+.

Replace skip_if_php_version('>=', '8.1.99') with the explicit '8.2'
version in bug1598-002 tests; '8.1.99' was used as a pre-release
placeholder when PHP 8.2 was not yet released.
@GromNaN GromNaN requested a review from a team as a code owner April 13, 2026 17:22
@GromNaN GromNaN requested review from Copilot and paulinevos and removed request for a team April 13, 2026 17:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes legacy PHPT tests and SKIPIF conditionals that only applied to PHP 7, aligning the test suite with the project’s PHP 8.1+ support policy (since v1.17).

Changes:

  • Deleted PHPT tests that were explicitly skipped on PHP 8 and only executed on PHP 7.
  • Simplified PHP-version SKIPIF checks for PHPC-1598 tests by switching from 8.1.99 to 8.2.
  • Updated one session test description and removed PHP 7-specific skips/comments now that PHP 7 is out of scope.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/writeConcern/writeconcern-ctor_error-001.phpt Removes a PHP 7-only constructor argument-count error test.
tests/writeConcern/bug1598-002.phpt Simplifies PHP version SKIPIF to skip on PHP ≥ 8.2.
tests/session/session-startTransaction_error-005.phpt Drops PHP 7 gating and PHP 8-only wording; test now applies generally to supported versions.
tests/session/session-startTransaction_error-004.phpt Removes a PHP 7-only TypeError behavior test.
tests/server/server-errors.phpt Removes a PHP 7-only server method argument-count error test.
tests/readPreference/bug1598-002.phpt Simplifies PHP version SKIPIF to skip on PHP ≥ 8.2.
tests/readConcern/readconcern-ctor_error-002.phpt Removes a PHP 7-only constructor type-validation test.
tests/readConcern/readconcern-ctor_error-001.phpt Removes a PHP 7-only constructor argument-count error test.
tests/readConcern/bug1598-002.phpt Simplifies PHP version SKIPIF to skip on PHP ≥ 8.2.
tests/manager/manager-ctor_error-001.phpt Removes a PHP 7-only manager constructor argument-count error test.
tests/cursor/bug1050-002.phpt Removes a PHP 7-only cursor behavior test that was skipped on PHP 8.
tests/bson/bug1598-002.phpt Simplifies PHP version SKIPIF to skip on PHP ≥ 8.2.
tests/bson/bson-timestamp_error-001.phpt Removes a PHP 7-only Timestamp argument-count error test.
tests/bson/bson-regex_error-001.phpt Removes a PHP 7-only Regex argument-count error test.
tests/bson/bson-objectid_error-001.phpt Removes a PHP 7-only ObjectId constructor type-validation test.
tests/bson/bson-objectid-tostring_error-001.phpt Removes a PHP 7-only ObjectId __toString argument error test.
tests/bson/bson-objectid-001.phpt Removes a PHP 7-only ObjectId roundtrip/validation test.
tests/bson/bson-javascript_error-001.phpt Removes a PHP 7-only Javascript argument-count error test.
tests/bson/bson-decimal128_error-001.phpt Removes a PHP 7-only Decimal128 validation/error test.
tests/bson/bson-binary_error-005.phpt Removes a PHP 7-only Binary vector argument-count error test.
tests/bson/bson-binary_error-001.phpt Removes a PHP 7-only Binary argument-count error test.
tests/apm/bug0950-002.phpt Removes a PHP 7-only APM regression test that was skipped on PHP 8.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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