Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Yoast/PHPUnit-Polyfills
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.2
Choose a base ref
...
head repository: Yoast/PHPUnit-Polyfills
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.0.3
Choose a head ref
  • 13 commits
  • 17 files changed
  • 2 contributors

Commits on Nov 3, 2021

  1. GH Actions: split off lint workflow

    Execute linting in a separate workflow from running the tests.
    jrfnl committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    8ee6910 View commit details
    Browse the repository at this point in the history
  2. GH Actions: further improve PHP ini settings

    * `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
    jrfnl committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    e082fe6 View commit details
    Browse the repository at this point in the history
  3. GH Actions: auto-cancel previous builds for same branch

    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
    jrfnl committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    38841dc View commit details
    Browse the repository at this point in the history
  4. Merge pull request #63 from Yoast/feature/ghactions-various-improvements

    GH Actions: various improvements
    jrfnl authored Nov 3, 2021
    Configuration menu
    Copy the full SHA
    33024ff View commit details
    Browse the repository at this point in the history
  5. Tests: tweaks for PHPUnit 10.x compatibility

    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.
    jrfnl committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    fd6d557 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #64 from Yoast/feature/PHPUnit-10-tweak

    Tests: tweaks for PHPUnit 10.x compatibility
    jrfnl authored Nov 3, 2021
    Configuration menu
    Copy the full SHA
    0670f2e View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2021

  1. AssertClosedResource: improve error messages

    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.
    jrfnl committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    d7c0982 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #65 from Yoast/feature/assertclosedresource-improv…

    …e-error-message
    
    AssertClosedResource: improve error messages
    jrfnl authored Nov 11, 2021
    Configuration menu
    Copy the full SHA
    8a5d6e4 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2021

  1. Test bootstrap: declare the PHPUNIT_TESTSUITE constant

    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".
    jrfnl committed Nov 18, 2021
    Configuration menu
    Copy the full SHA
    6732940 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #66 from Yoast/feature/tests-minor-stabilization

    Test bootstrap: declare the `PHPUNIT_TESTSUITE` constant
    jrfnl authored Nov 18, 2021
    Configuration menu
    Copy the full SHA
    0b45bcc View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2021

  1. Changelog for release 1.0.3

    Includes updating the `VERSION` constant in the `Autoload` class.
    jrfnl committed Nov 23, 2021
    Configuration menu
    Copy the full SHA
    5cec6c0 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #67 from Yoast/feature/changelog-1.0.3

    Changelog for release 1.0.3
    jrfnl authored Nov 23, 2021
    Configuration menu
    Copy the full SHA
    a6d09df View commit details
    Browse the repository at this point in the history
  3. Merge pull request #68 from Yoast/develop

    Release version 1.0.3
    jrfnl authored Nov 23, 2021
    Configuration menu
    Copy the full SHA
    5ea3536 View commit details
    Browse the repository at this point in the history
Loading