Tests: drop support for PHPUnit < 8 #994
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Tests: the unit tests now require PHPUnit 8+
Tests: remove work-arounds for expecting exceptions
AbstractFilterTestCase: remove work-around for change to PHPUnit
getMockBuilder()
Tests: remove work-arounds for setup/teardown methods
As of PHPUnit 8, the
setUpBeforeClass()
,setUp()
,tearDown()
andtearDownAfterClass()
method were required to have avoid
return type declaration.This could previously not be applied as the test suite had to stay compatible with PHP < 7.2, so as a work-around, the
@beforeClass
,@before
,@after
and@afterClass
annotations were used for these setup/teardown methods.As support for PHPUnit < 8 has now been dropped, this work-around is no longer needed and the methods can use the more customary PHPUnit fixture method signature again.
Tests: remove work-arounds for @requires tags
PHPUnit supports the
@requires OSFAMILY ...
syntax since PHPUnit 7.As this new type doesn't allow for negation, the
@requires OS ^(?!WIN).*
for thePrepareForOutputTest::testPrepareForOutput()
method needs to remain as it should run when not on Windows.Tests: use assertIs[Type] assertions
These assertions were introduced in PHPUnit 7.5.0 to replace the
assertInternalType()
assertion method.To not have PHPUnit version toggles everywhere, the assertions used native PHP in combination with
assertTrue()
for now.As support for PHPUnit < 8 has been dropped though, we can now use the PHPUnit native
assertIs[Type]()
assertions.Suggested changelog entry
Changed:
The minimum required PHPUnit version for the test framework has changed from 4.0 to 8.0.
Related issues/external references
Related to #25