Make WordPress Core


Ignore:
Timestamp:
09/21/2021 07:28:47 PM (3 years ago)
Author:
desrosj
Message:

Build/Test Tools: Introduce the PHPUnit Polyfills package for easier cross branch testing.

This backports the PHPUnit Polyfills package and related test infrastructure changes to make it easier for developers to continue testing on multiple versions WordPress while adding tests for newer versions of PHP, which require more modern PHPUnit practices.

One of the changes included is the addition of wrappers for the new snake_case fixture methods in PHPUnit. This allows the native camelCase standard in PHPUnit to be used, but allows for developers to transition to the new naming conventions.

Props hellofromTonya, jrf, SergeyBiryukov, johnbillion, netweb, schlessera, jeherve, lucatume, desrosj.
Merges [51559,51560,51810-51813,51828] to the 5.7 branch.
See #53911.

Location:
branches/5.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.7

  • branches/5.7/.github/workflows/phpunit-tests.yml

    r50671 r51839  
    2222env:
    2323  PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
    24   COMPOSER_INSTALL: ${{ false }}
    2524  # Controls which NPM script to use for running PHPUnit tests. Options ar `php` and `php-composer`.
    2625  PHPUNIT_SCRIPT: php
     
    138137      - name: Get composer cache directory
    139138        id: composer-cache
    140         if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
    141139        run: echo "::set-output name=dir::$(composer config cache-files-dir)"
    142140
    143141      - name: Cache Composer dependencies
    144         if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
    145142        uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    146143        env:
     
    151148
    152149      - name: Install Composer dependencies
    153         if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
    154150        run: |
    155151          docker-compose run --rm php composer --version
     
    161157            docker-compose run --rm php composer install --ignore-platform-reqs
    162158            echo "PHPUNIT_SCRIPT=php-composer" >> $GITHUB_ENV
     159          elif [ ${{ env.LOCAL_PHP }} == '7.1-fpm' ]; then
     160            docker-compose run --rm php composer update
     161            git checkout -- composer.lock
     162          elif [[ ${{ env.LOCAL_PHP }} == '5.6.20-fpm' || ${{ env.LOCAL_PHP }} == '7.0-fpm' ]]; then
     163            docker-compose run --rm php composer require --dev phpunit/phpunit:"^5.7" --update-with-dependencies
     164            git checkout -- composer.lock composer.json
    163165          else
    164166            docker-compose run --rm php composer install
Note: See TracChangeset for help on using the changeset viewer.