Make WordPress Core


Ignore:
Timestamp:
09/21/2021 07:29:38 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.6 branch.
See #53911.

Location:
branches/5.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.6

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

    r50672 r51840  
    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 || env.LOCAL_PHP == '8.0-fpm' }}
    143141        run: echo "::set-output name=dir::$(composer config cache-files-dir)"
    144142
    145143      - name: Cache Composer dependencies
    146         if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
    147144        uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    148145        env:
     
    153150
    154151      - name: Install Composer dependencies
    155         if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
    156152        run: |
    157153          docker-compose run --rm php composer --version
     
    163159            docker-compose run --rm php composer install --ignore-platform-reqs
    164160            echo "PHPUNIT_SCRIPT=php-composer" >> $GITHUB_ENV
     161          elif [ ${{ env.LOCAL_PHP }} == '7.1-fpm' ]; then
     162            docker-compose run --rm php composer update
     163            git checkout -- composer.lock
     164          elif [[ ${{ env.LOCAL_PHP }} == '5.6.20-fpm' || ${{ env.LOCAL_PHP }} == '7.0-fpm' ]]; then
     165            docker-compose run --rm php composer require --dev phpunit/phpunit:"^5.7" --update-with-dependencies
     166            git checkout -- composer.lock composer.json
    165167          else
    166168            docker-compose run --rm php composer install
Note: See TracChangeset for help on using the changeset viewer.