Skip to content

PHPUnit project mode keeps Playground's pretty permalinks instead of core's plain test-install state #2628

Done

Description

@chubes4

Problem

In bootstrap-mode=project, the PHPUnit runtime sets WP_TESTS_SKIP_INSTALL=1 and reuses the site that Playground installed (packages/runtime-playground/src/phpunit-command-handlers.ts, the project-mode branch). Playground's installer sets permalink_structure to /%year%/%monthnum%/%day%/%postname%/ (playground/wordpress/src/boot.ts, installWordPress). Core's test install (tests/phpunit/includes/install.php) deletes permalink_structure, so every other WordPress test environment starts with plain permalinks. WP_UnitTestCase resets permalinks only when WP_RUN_CORE_TESTS is set, so a plugin suite keeps the pretty structure.

Effect

Plugin tests that build URLs through add_query_arg() and compare them with core output fail only under Codebox. Example from a Homeboy WordPress-extension run of Jetpack's wpcomsh suite on unmodified trunk (--setting database_type=mysql):

✘ Redirects an old author slug with data set "paged"
-'http://127.0.0.1:61571/author/newslug/?paged=2'
+'http://127.0.0.1:61571/author/newslug/page/2/'

The same test passes in Jetpack CI, which runs core's installer against MariaDB.

Desired

In project mode, the database starts in the same state core's test install leaves it: permalink_structure is empty and rewrite rules are flushed (or install.php runs in-process, as managed mode does). Test: a project-mode PHPUnit run asserts get_option( 'permalink_structure' ) === '' before the first test.

AI disclosure: Claude Opus (Pi, via Roadie) traced this from the run artifact and the Codebox and Playground source, and wrote this issue.

Activity

  1. chubes4 commented on Dec 5, 2026

    @chubes4
    CollaboratorAuthor

    Fixed by #2634.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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