Skip to content

PHPUnit runner bundle can omit DefaultTestResultCache autoload mapping #1985

Description

@chubes4

Problem

A managed wordpress.phpunit workload can mount PHPUnit's TextUI/TestRunner.php while its Composer autoloader cannot resolve PHPUnit\\Runner\\DefaultTestResultCache.

Observed with WP Codebox 0.12.14 through Homeboy's WordPress test extension:

wordpress.phpunit could not run: Error: Class \"PHPUnit\\Runner\\DefaultTestResultCache\" not found at /tmp/wp-codebox-inputs/.../phpunit/phpunit/src/TextUI/TestRunner.php:195

The plugin under test has a tracked Composer lockfile but does not itself require PHPUnit. WP Codebox supplies the PHPUnit/wp-phpunit input bundle. The runtime reaches run_workloads, installs WordPress, mounts the plugin, and then fails before discovering or executing any tests.

Reproduction

Run a managed WordPress PHPUnit recipe against a plugin that has phpunit.xml tests but does not declare phpunit/phpunit in its own Composer requirements. Pass any filter. The generated command uses the WP Codebox vendor input as autoload-file; TestRunner loads, but DefaultTestResultCache does not.

Expected

The PHPUnit distribution and autoloader supplied by WP Codebox are internally complete and version-aligned. A component should not need to add a redundant PHPUnit dependency merely to repair the runtime-owned test runner.

Evidence

  • failure phase: run_workloads
  • WP Codebox package: 0.12.14
  • runtime artifact command: wordpress.phpunit
  • no tests execute (total: 0)
  • the prior archive-cache lock was independently cleared; this failure occurs after successful runtime startup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions