Closed (fixed)
Project:
Drupal core
Version:
8.9.x-dev
Component:
phpunit
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 May 2020 at 20:45 UTC
Updated:
14 Aug 2020 at 17:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mondrakeComment #3
sja112 commentedComment #4
sja112 commentedComment #5
ketikagrover commentedComment #6
daffie commentedPatch no longer applies.
Comment #7
munish.kumar commentedPatch rerolled for 9.1.
Comment #8
sivaji_ganesh_jojodae commentedComment #9
daffie commentedThe latest patch returns with 4 coding standards messages. See: https://www.drupal.org/pift-ci-job/1710147.
Comment #10
pavnish commentedComment #11
shaktikComment #12
shaktikHi @daffie,
solved returns with 4 coding standards messages, kindly check.
Comment #13
daffie commentedA quick review of the interdiff file:
This change is missing a comma character.
Comment #14
pavnish commented@daffie #13 has been changed.
Please review this patch.
Comment #15
daffie commentedThe latest patch returns a coding standard violation. See: https://www.drupal.org/pift-ci-job/1711330
Comment #16
munish.kumar commentedHi @pavnish, You latest patch contains a coding standard issue, Fixed this issue and uploaded interdiff for the same.
Comment #17
munish.kumar commentedIgnore the previous patch, Here is the updated patch which addresses #15 issues.
Comment #19
Rkumar commentedPatch looks clean and didn't find any other occurrence of assertPattern() with a message.
So moving it to RTBC.
Comment #20
mondrakeComment #21
Lal_Comment #22
daffie commentedReroll is done correctly.
Back to RTBC.
Comment #23
xjmI read over all the removed messages in the patch, and I think that the inline comments are being added in all the cases where existing comments don't already provide sufficient information. Nice work!
I did a broad search for places that might have the second parameter with a non-regexy grep:
Those are all false positives, except the method on
AssertContentTraititself. So, this isn't like the other issue where the message wasn't supported at all, is it?Is the message not being printed? Should we be deprecating passing a message to the method?
Technically out of scope, but OK. :)
Hmm, also out of scope, and less close to the issue scope.
I'm mostly interested in more information for point 1, but let's fix 2 and 3 while we're at it. Thanks!
Comment #24
shaktikreverted point 2 and 3.
Comment #25
mondrake@xjm re #23.1 I think your regex starting point is wrong - like this you capture the calls that have a function in the concatenation of the pattern string, and that function has multiple arguments.
Comment #26
mondrakeThanks
Comment #27
mondrakeI read again #23.1, my comment in #25 is not relevant to the question.
AssertContentTraitis not touched by this chain of issues, it's not in any deprecation stage. True, the assert methods there all have $message and $group, with the former in use and the latter totally irrelevant. Also they could be PHPUnitised a bit more. But that IMHO should be a totally separate endeavour. It's not even a followup.Comment #28
catchOpened #3162193: Modernize AssertContentTrait.
Patch needs a re-roll.
Comment #29
ravi.shankar commentedAdded a reroll of patch #24.
Comment #30
mondrakeThanks.
Comment #31
alexpottCommitted and pushed 402567d128 to 9.1.x and 0c53f5b191 to 9.0.x and 2c1c4e601e to 8.9.x. Thanks!
Backported to 8.9.x to keep tests in-sync.
This change is tricky. This is a kernel test. It's using \Drupal\KernelTests\AssertContentTrait::assertPattern() which still supports $message. That said the default message added by AssertContentTrait::assertPattern() is okay so let's proceed.