Define a standard for documenting data providers in PHPUnit-based tests

Created on 24 October 2017, over 6 years ago
Updated 21 June 2024, 7 days ago

Problem/Motivation

Part of #2057905: [policy, no patch] Discuss the standards for phpunit based tests β†’

Problem/Motivation

We have no standards for how data providers are documented in PHPUnit tests. If we follow the core standards of documenting @return and @param tests will have a lot of boilerplate that does not add much. However, if we mandate that every set of arguments is keyed by a meaningful string then this is super useful.

Proposed resolution

tbd

Remaining tasks

Come up with an enforceable standard

Benefits

If we adopted this change, the Drupal Project would benefit by ...

Three supporters required

  1. https://www.drupal.org/u/ β†’ {userid} (yyyy-mm-dd they added support)
  2. https://www.drupal.org/u/ β†’ {userid} (yyyy-mm-dd they added support)
  3. https://www.drupal.org/u/ β†’ {userid} (yyyy-mm-dd they added support)

Proposed changes

Provide all proposed changes to the Drupal Coding standards β†’ . Give a link to each section that will be changed, and show the current text and proposed text as in the following layout:

1. {link to the documentation heading that is to change}

Add current text in blockquotes

Add proposed text in blockquotes

2. Repeat the above for each page or sub-page that needs to be changed.

Remaining tasks

  1. Add supporters
  2. Create a Change Record
  3. Review by the Coding Standards Committee
  4. Coding Standards Committee takes action as required
  5. Discussed by the Core Committer Committee, if it impacts Drupal Core
  6. Final review by Coding Standards Committee
  7. Documentation updates
    1. Edit all pages
    2. Publish change record
    3. Remove 'Needs documentation edits' tag
  8. If applicable, create follow-up issues for PHPCS rules/sniffs changes

For a full explanation of these steps see the Coding Standards project page β†’

πŸ“Œ Task
Status

Active

Component

Coding Standards

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024