Conversation
|
Updated with 38efccb after merging current trunk. The separate-process capability test previously passed user ID 0 to Validation:
|
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
38efccb to
8c81776
Compare
Name the class and file for the condition under test so direct PHPUnit file execution discovers it. Explain why the test needs both process isolation and a separate class from Tests_User_MapMetaCap. Remove the redundant super-admin cleanup; test teardown rolls back the site option before the isolated process exits.
Keep temporary user IDs out of shared query fixtures and refresh the shared administrator object so capability changes are cleaned up on the instance used by later tests. Move the `DISALLOW_UNFILTERED_HTML` test into its own file and process, with an administrator fixture and super-admin privileges on multisite. This contains the constant and prevents child-process teardown from deleting another class's fixtures. Restrict the auto-increment lookup to the active database. Developed in: #13187 Props jonsurrell. See #65893. git-svn-id: https://develop.svn.wordpress.org/trunk@63614 602fd350-edb4-49c9-b593-d223f7449a82
Keep temporary user IDs out of shared query fixtures and refresh the shared administrator object so capability changes are cleaned up on the instance used by later tests. Move the `DISALLOW_UNFILTERED_HTML` test into its own file and process, with an administrator fixture and super-admin privileges on multisite. This contains the constant and prevents child-process teardown from deleting another class's fixtures. Restrict the auto-increment lookup to the active database. Developed in: WordPress/wordpress-develop#13187 Props jonsurrell. See #65893. Built from https://develop.svn.wordpress.org/trunk@63614 git-svn-id: http://core.svn.wordpress.org/trunk@62790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Avoid mutating shared user IDs, refresh the shared capability fixture, and isolate the capability test that defines
DISALLOW_UNFILTERED_HTML. Also restrict theINFORMATION_SCHEMAlookup to the active database so it cannot read another test database's auto-increment value.The constant test has its own file and class,
Tests_User_MapMetaCapDisallowUnfilteredHtml, so PHPUnit discovers it when invoked by file. A separate process prevents the constant from affecting later tests. A separate class prevents the child process's class teardown from deleting fixtures still needed byTests_User_MapMetaCapin the parent process. The isolated test creates its own administrator and grants super-admin privileges on multisite; test teardown rolls back that grant.Verified locally on 2026-09-14 with PHP 8.5.10 and PHPUnit 9.6.36:
usergroup with seed1789039001: 1,344 tests / 4,534 assertions on single site and 1,403 / 5,000 on multisite. Both exit 0 with five existing PHPUnit deprecation warnings; single site also has one skip.git diff --checkpasses.Trac: https://core.trac.wordpress.org/ticket/65893