Making WordPress.org

Changeset 14810


Ignore:
Timestamp:
04/13/2026 05:39:15 PM (4 weeks ago)
Author:
obenland
Message:

Improve PHPUnit test infrastructure for the Plugin Directory.

Add a dedicated wp-env test configuration so Plugin Directory tests
run in the tests-cli container with PHPUnit 11 and Yoast Polyfills.

Props dd32, obenland.
Closes https://github.com/WordPress/wordpress.org/pull/588

Location:
sites/trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/.github/workflows/unit-tests.yml

    r14720 r14810  
    6969          - name: Plugin Directory
    7070            working-directory: environments
    71             wp-env-args: "--config plugin-directory/.wp-env.json"
    72             container: cli
     71            wp-env-args: "--config plugin-directory/.wp-env.test.json"
     72            container: tests-cli
    7373            plugin-name: plugin-directory
    7474    steps:
  • sites/trunk/.gitignore

    r14754 r14810  
    11node_modules/
    22vendor/
     3.phpunit.result.cache
    34.svn/
  • sites/trunk/composer.json

    r14755 r14810  
    1313        "wp-coding-standards/wpcs": "^3.3.0",
    1414        "phpcompatibility/phpcompatibility-wp": "*",
    15         "sirbrillig/phpcs-changed": "^2.12.0"
     15        "sirbrillig/phpcs-changed": "^2.12.0",
     16        "phpunit/phpunit": "^11.0",
     17        "yoast/phpunit-polyfills": "^4.0"
    1618    },
    1719    "scripts": {
  • sites/trunk/environments/README.md

    r14753 r14810  
    4646```bash
    4747npx wp-env run cli wp <command>
     48```
     49
     50**Run tests:**
     51
     52```bash
     53npm run plugins:test
    4854```
    4955
  • sites/trunk/environments/package.json

    r14753 r14810  
    1010        "plugins:import": "npm run plugins:env -- run cli -- php wp-content/plugins/plugin-directory/bin/import-plugin.php --create --plugin",
    1111        "plugins:refresh": "npm run plugins:env -- run cli -- wp option delete wporg_env_imported && npm run plugins:env -- run cli wp eval-file wp-content/env-bin/import-plugins.php",
     12        "plugins:test:env": "wp-env --config plugin-directory/.wp-env.test.json",
     13        "plugins:test": "npm run plugins:test:env -- start && npm run plugins:test:env -- run tests-cli --env-cwd=wp-content/plugins/plugin-directory phpunit",
    1214        "jobs:env": "wp-env --config jobs/.wp-env.json"
    1315    },
Note: See TracChangeset for help on using the changeset viewer.