Conversation
Execute linting in a separate workflow from running the tests.
* `E_ALL` does not really contain **ALL** PHP notices across all PHP versions, in some `E_STRICT`, for instance, is excluded from `E_ALL`, so using `-1` is the better choice as that will always contain everything.
* While assertions are (as far as I'm aware) not currently used in the code base, it's still a good idea to enable `zend_assertions` in case something would be changed in the test tooling used.
This is one of the other ini settings which is not turned on by default in the `setup-php` action.
Ref: https://www.php.net/manual/en/ini.core.php#ini.zend.assertions
In Travis, when the same branch was pushed again and the "Auto cancellation" option on the "Settings" page had been turned on (as it was for most repos), any still running builds for the same branch would be stopped in favour of starting the build for the newly pushed version of the branch. To enable this behaviour in GH Actions, a `concurrency` configuration needs to be added to each workflow for which this should applied to. More than anything, this is a way to be kind to GitHub by not wasting resources which they so kindly provide to us for free. Refs: * https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/ * https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency
GH Actions: various improvements
Initial tweaks to make the tests compatible with PHPUnit 10.x, which enforces a `mixed` return type for the `TestCase::runTest()` method. To test the TestListener, prior to PHPUnit 7.0, overloading the `runTest()` method works best, but as of PHPUnit 10.0, the `runTest()` method has a `mixed` return type declaration (PHP 8.0+). However, since PHPUnit 7.0, testing the TestListener also works when the test name with which the `TestCase` is instantiated is not `runTest()`. So either way, the fixtures used for the TestListener tests need to be duplicated and have two variations. Now the choice was which option to choose: * Duplicate the classes and add a return type to the `runTest()` method. * Duplicate the classes and rename the test method. I investigated both options and have decided to implement option 2 as `void` is not accepted as covariant with `mixed` and these methods are all `void` methods, so adding `mixed` as the return type would be misrepresenting the functionality. The toggle for which test class to load for the various tests has been implemented with a helper method.
Tests: tweaks for PHPUnit 10.x compatibility
The `sebastian/exporter` package has been a dependency of PHPUnit from before PHPUnit 4.8.x (minimum supported version by this library), so it is safe to use the same variable export methodology as PHPUnit itself uses. The class is prefixed via PHP_Scoper when it is includes as part of a PHPUnit Phar file and the toggle added will make sure the class can be loaded both when run via a Composer install, as well as when run via a Phar file. Also note that the Exporter reports closed resources as `NULL`. This has been reported upstream via sebastianbergmann/exporter#36 and for the polyfill a fix has been put in place to work around this. **Important**: While the `sebastian/exporter` package has , in effect, now become a direct dependency of the Polyfills, I'm not going to declare it as such in the `composer.json` file as for all supported PHPUnit versions, the package will already be available via PHPUnit itself, whether installed via Composer or as a PHAR. This prevent potential version conflicts when tests are run via the PHAR, while the Polyfills have been installed via Composer and saves hassle of having to take care of autoloading the Exporter file, while it will be loaded for PHPUnit itself anyway.
…e-error-message AssertClosedResource: improve error messages
This constant signals to PHPUnit that the tests themselves may run other tests and will prevent tests on older PHPUnit versions from being marked as "risky" for "closing more than just their own buffers".
Test bootstrap: declare the `PHPUNIT_TESTSUITE` constant
Includes updating the `VERSION` constant in the `Autoload` class.
Changelog for release 1.0.3
Collaborator
Author
|
Release tweet: https://twitter.com/jrf_nl/status/1462960538409910272 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Functional:
VERSIONconstant in thephpunitpolyfills-autoload.phpfile. - PR Changelog for release 1.0.3 #67Release:
Verify that a release link at the bottom of the
CHANGELOG.mdfile has been added.develop!).develop!) & copy & paste the changelog to it.Make sure to copy the links to the issues and the links to the GH usernames from the bottom of the changelog!
Announce: