Skip to content

Commit 134921b

Browse files
authored
Merge pull request #254 from Yoast/feature/4.x/changelog-v4.0.0
Changelog for the 4.0.0 release and other documentation updates
2 parents b7d234f + 467709f commit 134921b

File tree

3 files changed

+47
-7
lines changed

3 files changed

+47
-7
lines changed

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,45 @@ This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses
99

1010
_Nothing yet._
1111

12+
## [4.0.0] - 2025-02-09
13+
14+
### PHPUnit 12 support
15+
16+
This release updates the PHPUnit Polyfills to allow for _"writing your tests for PHPUnit 12 and running them all the way back to PHPUnit 7"_. \[*\]
17+
18+
Please keep in mind that the PHPUnit Polyfills provide _forward_-compatibility. This means that features which PHPUnit no longer supports in PHPUnit 12.x, are also no longer supported in the 4.0 release of the PHPUnit Polyfills.
19+
20+
Please refer to the [PHPUnit 12 release notification] and [PHPUnit 12 changelog] to inform your decision on whether or not to upgrade (yet).
21+
22+
Projects which don't use any of the new or removed functionality in their test suite, can, of course, use the PHPUnit Polyfills 1.x, 2.x, 3.x and 4.x series side-by-side, like so `composer require --dev yoast/phpunit-polyfills:"^1.0 || ^2.0 || ^3.0 || ^4.0"`.
23+
24+
[PHPUnit 12 release notification]: https://phpunit.de/announcements/phpunit-12.html
25+
[PHPUnit 12 changelog]: https://github.com/sebastianbergmann/phpunit/blob/12.0.2/ChangeLog-12.0.md
26+
27+
\[*\]: _Note: Releases from the PHPUnit Polyfills 4.x branch will support running tests on PHPUnit 7.5.0 - 9.x, 11.x and 12.x, but will not allow for running tests on PHPUnit 10 (for reasons explained in [#200])._
28+
_In practical terms, the net effect of this is that tests on PHP 8.1 will run on PHPUnit 9 instead of PHPUnit 10. Other than that, there is no impact._
29+
30+
31+
### Changelog
32+
33+
#### Changed
34+
* Composer: allow for installation of PHPUnit 12.x. PR [#247]
35+
* Scalar parameter type declarations and return type declarations are now used where possible. PR [#241]
36+
* General housekeeping.
37+
38+
#### Removed
39+
* Support for PHP < 7.1. PR [#238].
40+
* Support for PHPUnit < 7.5.0. PR [#239].
41+
* The `Yoast\PHPUnitPolyfills\Polyfills\AssertIsType` trait which is no longer needed now support for PHPUnit < 7.5 has been dropped. PR [#239].
42+
* The `Yoast\PHPUnitPolyfills\Polyfills\AssertStringContains` trait which is no longer needed now support for PHPUnit < 7.5 has been dropped. PR [#239].
43+
* The `Yoast\PHPUnitPolyfills\Polyfills\AssertEqualsSpecializations` trait which is no longer needed now support for PHPUnit < 7.5 has been dropped. PR [#239].
44+
45+
[#238]: https://github.com/Yoast/PHPUnit-Polyfills/pull/238
46+
[#239]: https://github.com/Yoast/PHPUnit-Polyfills/pull/239
47+
[#241]: https://github.com/Yoast/PHPUnit-Polyfills/pull/241
48+
[#247]: https://github.com/Yoast/PHPUnit-Polyfills/pull/247
49+
50+
1251
## [3.1.2] - 2025-02-09
1352

1453
This is a maintenance release.
@@ -400,6 +439,7 @@ Initial release.
400439

401440

402441
[Unreleased]: https://github.com/Yoast/PHPUnit-Polyfills/compare/main...HEAD
442+
[4.0.0]: https://github.com/Yoast/PHPUnit-Polyfills/compare/3.1.2...4.0.0
403443
[3.1.2]: https://github.com/Yoast/PHPUnit-Polyfills/compare/3.1.1...3.1.2
404444
[3.1.1]: https://github.com/Yoast/PHPUnit-Polyfills/compare/3.1.0...3.1.1
405445
[3.1.0]: https://github.com/Yoast/PHPUnit-Polyfills/compare/3.0.0...3.1.0

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PHPUnit Polyfills
55
[![CS Build Status](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/cs.yml/badge.svg)](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/cs.yml)
66
[![Lint Build Status](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/lint.yml/badge.svg)](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/lint.yml)
77
[![Test Build Status](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/test.yml/badge.svg)](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/test.yml)
8-
[![Coverage Status](https://coveralls.io/repos/github/Yoast/PHPUnit-Polyfills/badge.svg?branch=3.x)](https://coveralls.io/github/Yoast/PHPUnit-Polyfills?branch=3.x)
8+
[![Coverage Status](https://coveralls.io/repos/github/Yoast/PHPUnit-Polyfills/badge.svg?branch=4.x)](https://coveralls.io/github/Yoast/PHPUnit-Polyfills?branch=4.x)
99

1010
[![Minimum PHP Version](https://img.shields.io/packagist/dependency-v/yoast/phpunit-polyfills/php.svg)][Packagist]
1111
[![License: BSD3](https://img.shields.io/github/license/Yoast/PHPUnit-Polyfills)](https://github.com/Yoast/PHPUnit-Polyfills/blob/main/LICENSE)
@@ -34,7 +34,7 @@ Requirements
3434
------------
3535

3636
* PHP 7.1 or higher.
37-
* [PHPUnit] 7.5 - 9.x and 11.x (automatically required via Composer).
37+
* [PHPUnit] 7.5 - 9.x, 11.x and 12.x (automatically required via Composer).
3838

3939
[PHPUnit]: https://packagist.org/packages/phpunit/phpunit
4040

@@ -44,7 +44,7 @@ Installation
4444

4545
To install this package, run:
4646
```bash
47-
composer require --dev yoast/phpunit-polyfills:"^3.0"
47+
composer require --dev yoast/phpunit-polyfills:"^4.0"
4848
```
4949

5050
To update this package, run:
@@ -64,7 +64,7 @@ Why use the PHPUnit Polyfills?
6464

6565
This library is set up to allow for creating PHPUnit cross-version compatible tests by offering a number of polyfills for functionality which was introduced, split up or renamed in PHPUnit.
6666

67-
### Write your tests for PHPUnit 11.x and run them on PHPUnit 7.5 - 11.x
67+
### Write your tests for PHPUnit 12.x and run them on PHPUnit 7.5 - 12.x
6868

6969
The polyfills have been setup to allow tests to be _forward_-compatible. What that means is, that your tests can use the assertions supported by the _latest_ PHPUnit version, even when running on older PHPUnit versions.
7070

@@ -698,15 +698,15 @@ if ( defined( '\Yoast\PHPUnitPolyfills\Autoload::VERSION' ) === false
698698
}
699699
```
700700

701-
### Q: Why don't the PHPUnit Polyfills 3.x versions support running tests on PHPUnit 10 ?
701+
### Q: Why don't the PHPUnit Polyfills 3.x and 4.x versions support running tests on PHPUnit 10 ?
702702

703703
PHPUnit 11.0 introduced the `expectUserDeprecationMessage*()` methods. To polyfill these for PHPUnit 10 would mean that the Polyfills package could no longer be a "drop-in" helper package, but would need to set extra requirements on test suites using the polyfills when used with PHPUnit 10 (like hooking into events or compulsory use of the `TestCase`s provided by this package).
704704

705705
As it was deemed desirable enough to polyfill the methods, the releases from the 3.x branch of the PHPUnit Polyfills do not support running tests on PHPUnit 10.
706706

707707
The impact of this compromise is minimal, as, in the most common case of running the tests with Composer installed dependencies, this just and only means that test runs on PHP 8.1 will use PHPUnit 9 instead of PHPUnit 10. There is no other impact.
708708

709-
Keep in mind that functionality _added_ in PHPUnit 10, is still polyfilled and available in PHPUnit Polyfills 3.x.
709+
Keep in mind that functionality _added_ in PHPUnit 10, is still polyfilled and available in PHPUnit Polyfills 3.x/4.x.
710710

711711

712712
Contributing

phpunitpolyfills-autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class Autoload {
2222
*
2323
* @var string
2424
*/
25-
public const VERSION = '4.0.0-dev';
25+
public const VERSION = '4.0.0';
2626

2727
/**
2828
* Loads a class.

0 commit comments

Comments
 (0)