---
title: "yoast/phpunit-polyfills 4.0.0 Breaking Changes on Packagist"
description: "What each yoast/phpunit-polyfills release removed, renamed or changed: 46 breaking changes in 3 versions on Packagist, each with its source."
canonical_url: https://since.dev/packages/packagist/yoast/phpunit-polyfills
last_updated: 2026-12-04
---

# yoast/phpunit-polyfills breaking changes

yoast/phpunit-polyfills 4.0.0 (February 9, 2025) is its newest release with breaking changes, 26 of them. The first: Drops support for PHPUnit versions below 7.5.0 in yoast/phpunit-polyfills 4.0.0. Every breaking API change we have recorded in yoast/phpunit-polyfills on Packagist: 46 breaking changes in 3 versions. Below, its 3 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `4.0.0`, released February 9, 2025. BSD-3-Clause license. [Source repository](https://github.com/Yoast/PHPUnit-Polyfills)

Its 3.0.0 release requires PHP 7.0 or later. [PHP end of life dates](https://since.dev/calendar/php.md).

- From [3.0.0](#v-3-0-0) to [4.0.0](#v-4-0-0): 26 breaking changes in 1 version.
- From [2.0.0](#v-2-0-0) to [4.0.0](#v-4-0-0): 35 breaking changes in 2 versions.

## yoast/phpunit-polyfills 4.0.0 breaking changes

yoast/phpunit-polyfills 4.0.0, released February 9, 2025: 26 breaking changes.

- **Removed**  

Support for PHPUnit < 7.5.0 has been removed. Test suites on older PHPUnit versions must upgrade PHPUnit or stay on an earlier release. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/4.0.0)
- **Removed**  

Releases in the 4.x series do not support running tests on PHPUnit 10. Test suites on PHPUnit 10 must use an earlier Polyfills release or upgrade PHPUnit. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/4.0.0)
- **Removed**  

Support for PHP < 7.1 has been removed in this release. Users on those PHP versions must stay on an earlier 3.x release. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/4.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertEqualsSpecializations`  

Yoast\\PHPUnitPolyfills\\Autoload::loadAssertEqualsSpecializations was removed in yoast/phpunit-polyfills 4.0.0 [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertIsType`  

Yoast\\PHPUnitPolyfills\\Autoload::loadAssertIsType was removed in yoast/phpunit-polyfills 4.0.0 [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertStringContains`  

Yoast\\PHPUnitPolyfills\\Autoload::loadAssertStringContains was removed in yoast/phpunit-polyfills 4.0.0 [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Polyfills\AssertEqualsSpecializations`  

The AssertEqualsSpecializations trait has been removed because it is no longer needed now that PHPUnit < 7.5 support is dropped. Stop using this trait in test classes. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/4.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Polyfills\AssertIsType`  

The AssertIsType trait has been removed because it is no longer needed now that PHPUnit < 7.5 support is dropped. Stop using this trait in test classes. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/4.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Polyfills\AssertStringContains`  

The AssertStringContains trait has been removed because it is no longer needed now that PHPUnit < 7.5 support is dropped. Stop using this trait in test classes. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::getPHPUnitVersion`  

Was public static function getPHPUnitVersion(); now public static function getPHPUnitVersion(): string. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::load`  

Was public static function load($className); now public static function load(string $className): bool. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertArrayWithListKeys`  

Was public static function loadAssertArrayWithListKeys(); now public static function loadAssertArrayWithListKeys(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertClosedResource`  

Was public static function loadAssertClosedResource(); now public static function loadAssertClosedResource(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertContainsOnly`  

Was public static function loadAssertContainsOnly(); now public static function loadAssertContainsOnly(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertFileEqualsSpecializations`  

Was public static function loadAssertFileEqualsSpecializations(); now public static function loadAssertFileEqualsSpecializations(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertIgnoringLineEndings`  

Was public static function loadAssertIgnoringLineEndings(); now public static function loadAssertIgnoringLineEndings(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertionRenames`  

Was public static function loadAssertionRenames(); now public static function loadAssertionRenames(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertIsList`  

Was public static function loadAssertIsList(); now public static function loadAssertIsList(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertObjectEquals`  

Was public static function loadAssertObjectEquals(); now public static function loadAssertObjectEquals(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertObjectNotEquals`  

Was public static function loadAssertObjectNotEquals(); now public static function loadAssertObjectNotEquals(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertObjectProperty`  

Was public static function loadAssertObjectProperty(); now public static function loadAssertObjectProperty(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadEqualToSpecializations`  

Was public static function loadEqualToSpecializations(); now public static function loadEqualToSpecializations(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadExpectExceptionMessageMatches`  

Was public static function loadExpectExceptionMessageMatches(); now public static function loadExpectExceptionMessageMatches(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadExpectUserDeprecation`  

Was public static function loadExpectUserDeprecation(); now public static function loadExpectUserDeprecation(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadTestCase`  

Was public static function loadTestCase(); now public static function loadTestCase(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)
- **Signature changed** `Yoast\PHPUnitPolyfills\Autoload::loadTestListenerDefaultImplementation`  

Was public static function loadTestListenerDefaultImplementation(); now public static function loadTestListenerDefaultImplementation(): void. [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#4.0.0)

## yoast/phpunit-polyfills 3.0.0 breaking changes

yoast/phpunit-polyfills 3.0.0, released September 7, 2024: 9 breaking changes.

- **Removed**  

The package no longer supports PHPUnit versions older than 6.4.4. Users on older PHPUnit must upgrade it first. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/3.0.0)
- **Removed**  

The package no longer supports PHP versions older than 7.0. Users on older PHP must stay on an earlier release. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/3.0.0)
- **Removed**  

The package no longer runs on PHPUnit 10.x, though it now allows installing PHPUnit 11.x. Users on PHPUnit 10 cannot use this release. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/3.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Autoload::loadExpectExceptionObject`  

Yoast\\PHPUnitPolyfills\\Autoload::loadExpectExceptionObject was removed in yoast/phpunit-polyfills 3.0.0 [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#3.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Helpers\AssertAttributeHelper`  

The helper was only a temporary measure for refactoring tests. Users must refactor any tests that still use it. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/3.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Polyfills\ExpectExceptionObject`  

The trait is no longer needed because support for PHPUnit below 6.4 was dropped. Users must stop using it. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/3.0.0)
- **Behavior changed** `assertIsList`  

The assertion failure message now follows the format used by PHPUnit 11.3.1 and later. Tests that match the old message text must be updated. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/3.0.0)
- **Behavior changed** `assertObjectEquals`  

The polyfill now behaves the same as PHPUnit's native method, which can change test outcomes. Users should check their object comparisons. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/3.0.0)
- **Signature changed** `expectExceptionMessageMatches`  

The method is now protected instead of public, so calls from outside the test class will fail. Users must stop calling it directly. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/3.0.0)

## yoast/phpunit-polyfills 2.0.0 breaking changes

yoast/phpunit-polyfills 2.0.0, released June 6, 2023: 11 breaking changes.

- **Removed**  

Test suites running on PHPUnit older than 5.7.21 are no longer supported by this release. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/2.0.0)
- **Removed**  

Code running on PHP older than 5.6 can no longer use this release; stay on 1.x or upgrade PHP. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/2.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertFileDirectory`  

Yoast\\PHPUnitPolyfills\\Autoload::loadAssertFileDirectory was removed in yoast/phpunit-polyfills 2.0.0 [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#2.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Autoload::loadAssertNumericType`  

Yoast\\PHPUnitPolyfills\\Autoload::loadAssertNumericType was removed in yoast/phpunit-polyfills 2.0.0 [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#2.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Autoload::loadExpectException`  

Yoast\\PHPUnitPolyfills\\Autoload::loadExpectException was removed in yoast/phpunit-polyfills 2.0.0 [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#2.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Autoload::loadExpectPHPException`  

Yoast\\PHPUnitPolyfills\\Autoload::loadExpectPHPException was removed in yoast/phpunit-polyfills 2.0.0 [packagist.org](https://packagist.org/packages/yoast/phpunit-polyfills#2.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Polyfills\AssertFileDirectory`  

The trait is gone because support for PHPUnit below 5.7 was dropped. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/2.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Polyfills\AssertNumericType`  

The trait is gone because support for PHPUnit below 5.7 was dropped. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/2.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Polyfills\ExpectException`  

The trait is gone because support for PHPUnit below 5.7 was dropped. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/2.0.0)
- **Removed** `Yoast\PHPUnitPolyfills\Polyfills\ExpectPHPException`  

Tests that expect PHP deprecations, notices, warnings or errors via this trait will break; PHPUnit 10 no longer supports this functionality. [github.com](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/2.0.0)

And 1 more in this version. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

## Related packages

- [yoast/wordpress-seo](https://since.dev/packages/packagist/yoast/wordpress-seo.md)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
