WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/21/2021 11:02:13 PM (4 months ago)
Author:
hellofromTonya
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.4 branch.
See #53911.

Location:
branches/5.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.4

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

    r50674 r51844  
    2424env:
    2525  PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
    26   COMPOSER_INSTALL: ${{ false }}
    2726  # Controls which NPM script to use for running PHPUnit tests. Options ar `php` and `php-composer`.
    2827  PHPUNIT_SCRIPT: php
     
    140139      - name: Get composer cache directory
    141140        id: composer-cache
    142         if: ${{ env.COMPOSER_INSTALL == true }}
    143141        run: echo "::set-output name=dir::$(composer config cache-files-dir)"
    144142
    145143      - name: Cache Composer dependencies
    146         if: ${{ env.COMPOSER_INSTALL == true }}
    147144        uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    148145        env:
     
    153150
    154151      - name: Install Composer dependencies
    155         if: ${{ env.COMPOSER_INSTALL == true }}
    156         run: |
    157           docker-compose run --rm php composer --version
    158           docker-compose run --rm php composer install
     152        run: |
     153          if [ ${{ env.LOCAL_PHP }} == '7.1-fpm' ]; then
     154            docker-compose run --rm php composer update
     155            git checkout -- composer.lock
     156          elif [[ ${{ env.LOCAL_PHP }} == '5.6.20-fpm' || ${{ env.LOCAL_PHP }} == '5.6-fpm' || ${{ env.LOCAL_PHP }} == '7.0-fpm' ]]; then
     157            docker-compose run --rm php composer require --dev phpunit/phpunit:"^5.7" --update-with-dependencies
     158            git checkout -- composer.lock composer.json
     159          else
     160            docker-compose run --rm php composer install
     161          fi
    159162
    160163      - name: Docker debug information
Note: See TracChangeset for help on using the changeset viewer.