Problem/Motivation
The PHPUnit --filter option works by pattern-matching. This means that
--filter=testFoo
will match 'function testFoo' and also 'function testFooBar'. AFAIK there is no way to make it a strict comparison.
This means that if you have a test class such as ContentEntityChangedTest with:
public function testChanged(): void {
public function testChangedSyncing(): void {
then it is not possible to run only testChanged when debugging.
Benefits
If we adopted this change, the Drupal Project would benefit by making local development easier.
Three supporters required
- https://www.drupal.org/u/{userid} (yyyy-mm-dd they added support)
- https://www.drupal.org/u/{userid} (yyyy-mm-dd they added support)
- 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}
Current text
Add current text in blockquotes
Proposed text
Add proposed text in blockquotes
2. Repeat the above for each page or sub-page that needs to be changed.
Remaining tasks
Create this issue in the Coding Standards queue, using the defined template- Add supporters
- Create a Change Record
- Review by the Coding Standards Committee
- Coding Standards Committee takes action as required
- Discussed at a Core Committee meeting, if it impacts Drupal Core
- Final review by Coding Standards Committee
- Documentation updates
- Edit all pages
- Publish change record
- Remove 'Needs documentation edits' tag
- If applicable, create follow-up issues for PHPCS rules/sniffs changes
For a full explanation of these steps see the Coding Standards project page
Comments
Comment #2
quietone commentedTry using a
$at then end of the filter pattern.The file core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php has test methods
testGetWeightandtestGetWeightDefault. Using--filter=testGetWeightresults in both tests running and using--filter=testGetWeight$results in justtestGetWeigh()running.Reference https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regula...
Comment #3
joachim commentedAh I hadn't thought of using a $ at the end!
In which case, we can maybe close this as not necessary.
Comment #4
quietone commented@joachim, thanks for commenting.
I also agree this can be closed and there is no need to add a coding standard for Drupal.