Yoast / PHPUnit-Polyfills

Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests
BSD 3-Clause "New" or "Revised" License
173 stars 13 forks source link

3.0 | Drop support for PHP < 7.0 #192

Closed jrfnl closed 2 months ago

jrfnl commented 2 months ago

Drop support for PHP < 7.0 [1]

Drop support for PHP < 7.0 [2]

Remove two polyfilled PHP native classes, which are no longer needed.

Drop support for PHP < 7.0 [3]

Simplify the tests for the AssertObjectEquals trait.

These tests had two flavours:

This mirror test class, and its associated test fixtures, are no longer needed now support for PHP < 7.0 is being dropped.

Drop support for PHP < 7.0 [4]

In the original implementation of the assertObjectEquals() polyfill, the polyfill could not mirror the PHPUnit native implementation completely as that required support for return types, which was only added in PHP 7.0, while the polyfill was introduced in PHPUnit Polyfills 1.0, which still supported PHP 5.5.

So instead of checking whether the "comparator" method had a return type declared and verifying that this return type complied with the requirements set by PHPUnit, the polyfill originally checked whether the returned value complied with the required type.

Now support for PHP < 7.0 is being dropped, the assertObjectEquals() polyfill can be updated to fix this implementation difference.

Includes unit tests for the changed functionality/new logic paths throwing exceptions. Includes updated documentation in the README.

Refs:

coveralls commented 2 months ago

Coverage Status

coverage: 96.423% (+0.6%) from 95.846% when pulling 8de2ad17ec60b04edc8a7954044992c6e292760d on feature/3.x/drop-support-for-php-7.0 into 61623d684bab7ae21a500f183274bdac0989a12d on 3.x.