WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#38193 closed enhancement (maybelater)

Unit test the "Roles and Capabilities" Codex page against core

Reported by: johnbillion Owned by: johnbillion
Milestone: Priority: low
Severity: normal Version:
Component: Role/Capability Keywords: has-patch
Focuses: Cc:
PR Number:

Description

The Roles and Capabilities page on the Codex can be fetched in a test and its contents tested against the roles and capabilities that are tested in core, to ensure that all capabilities used in core are listed on the page.

Attachments (2)

38193.patch (2.4 KB) - added by johnbillion 3 years ago.
38193.2.patch (3.2 KB) - added by johnbillion 3 years ago.

Download all attachments as: .zip

Change History (10)

#1 @johnbillion
3 years ago

  • Owner set to johnbillion
  • Status changed from new to accepted

#2 @johnbillion
3 years ago

  • Component changed from Users to Role/Capability

@johnbillion
3 years ago

#3 @johnbillion
3 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 4.7

38193.patch is a (currently failing) test that checks the Codex page for the existence of an element with an id attribute matching that of every capability used in core. This ensures that the Capabilities list on the page includes an entry for every capability.

The tests are currently failing because the page is missing entries for the following capabilities (which is the reason I decided to write this test).

  • create_sites
  • delete_sites
  • upload_plugins
  • upload_themes
  • customize
  • delete_site

I might expand on these tests some more and increase the specificity.

Make yourself known if you think these tests should not be in core.

#4 @netweb
3 years ago

Maybe add the tests to the @group external-http?

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


3 years ago

@johnbillion
3 years ago

#6 @johnbillion
3 years ago

Patch which adds the external-http group, and adds a test for roles in addition to capabilities.

The Codex page has been updated so these tests now pass, with the exception of the new capabilities introduced in #35614.

#7 @johnbillion
3 years ago

  • Milestone changed from 4.7 to Future Release

#8 @johnbillion
3 years ago

  • Milestone Future Release deleted
  • Resolution set to maybelater
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.