Use 'Drupal.NamingConventions.ValidFunctionName' in core/tests

Created on 25 April 2024, 5 months ago
Updated 30 April 2024, 4 months ago

Problem/Motivation

Enable 'Drupal.NamingConventions.ValidFunctionName' for core/tests/*

Steps to reproduce

Proposed resolution

Change casing as needed.
There are method name changes in core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php and core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php to remove the use of underscores.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
OtherΒ  β†’

Last updated about 8 hours ago

Created by

πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @quietone
  • Pipeline finished with Success
    5 months ago
    Total: 481s
    #156279
  • Status changed to Needs review 4 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand
  • Status changed to RTBC 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Kinda same as the other one I reviewed, leaning on the tests are green and the phpcs rule catching anything missed. The changes themselves make sense though.

  • Status changed to Needs review 4 months ago
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    Are we sure about this change? There is a PHP class \DOMXPath. I'm not sure that this is a good rule to implement in core for two reasons.
    1. PHP does not care about case for method names. If a class has a method getXPath() and I call getxpath() it'll work just fine.
    2. We might be forcing developers to make bad choices for no reason. For example, say you work for the BBC and you implementing a method getBBCListing() - there is probably a corporate standard that says BBC must always be capitalised but our coding standards prevent that. I'm not saying I particularly like the method name getBBCListing() but I'm not sure that our coding standards should have an opinion. Also if you are extending PHP's classes you have things like \DOMNode::C14N and \DOMNode::C14NFile.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Postponed the other 2 so main conversation can happen here.

  • Status changed to Needs work 4 months ago
  • The Needs Review Queue Bot β†’ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide β†’ to find step-by-step guides for working with issues.

Production build 0.71.5 2024