Make WordPress Core


Ignore:
Timestamp:
09/21/2021 07:04:34 PM (4 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.8 branch.
See #53911.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

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

    r51357 r51838  
    3131env:
    3232  PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
    33   COMPOSER_INSTALL: ${{ false }}
    3433  # Controls which NPM script to use for running PHPUnit tests. Options ar `php` and `php-composer`.
    3534  PHPUNIT_SCRIPT: php
     
    134133      - name: Get composer cache directory
    135134        id: composer-cache
    136         if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
    137135        run: echo "::set-output name=dir::$(composer config cache-files-dir)"
    138136
    139137      - name: Cache Composer dependencies
    140         if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
    141138        uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    142139        env:
     
    147144
    148145      - name: Install Composer dependencies
    149         if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
    150146        run: |
    151147          docker-compose run --rm php composer --version
     
    157153            docker-compose run --rm php composer install --ignore-platform-reqs
    158154            echo "PHPUNIT_SCRIPT=php-composer" >> $GITHUB_ENV
     155          elif [ ${{ env.LOCAL_PHP }} == '7.1-fpm' ]; then
     156            docker-compose run --rm php composer update
     157            git checkout -- composer.lock
     158          elif [[ ${{ env.LOCAL_PHP }} == '5.6.20-fpm' || ${{ env.LOCAL_PHP }} == '7.0-fpm' ]]; then
     159            docker-compose run --rm php composer require --dev phpunit/phpunit:"^5.7" --update-with-dependencies
     160            git checkout -- composer.lock composer.json
    159161          else
    160162            docker-compose run --rm php composer install
Note: See TracChangeset for help on using the changeset viewer.