The comment module uses Test class members with underscored names. Some examples are big_user, web_user and admin_user, but there could be others. According to our coding conventions, these should be renamed to bigUser, webUser and adminUser. In addition, some properties are undefined but should be.
See the parent issue #1811638: [meta] Clean-up Test members - ensure property definition and use of camelCase naming convention.
Note: The RDF module has one test which derives from CommentTestBase which is changed in these patches. That test has been corrected to work with the revised CommentTestBase in this patch. No other changes were made in the RDF module in this issue. See #2381921: Clean-up RDF module test members - ensure property definition and use of camelCase naming convention
Beta phase evaluation
| Issue category | Task, because this is a coding standards change. |
|---|---|
| Issue priority | Not critical because coding standard changes are not critical. |
| Unfrozen changes | Unfrozen because it only changes automated tests. |
| Disruption | There is no disruption expected from this sort of change. |
| Comment | File | Size | Author |
|---|---|---|---|
| #47 | interdiff-2380023-43-47.txt | 938 bytes | subhojit777 |
| #47 | clean_up_comment_module-2380023-47.patch | 50.08 KB | subhojit777 |
| #24 | comment-testing-camelcase-2380023-D8-24.patch | 50.09 KB | tibbsa |
Comments
Comment #1
cilefen commentedComment #2
tibbsa commentedChanged CommentTestBase::web_user -> webUser; CommentTestBase::admin_user -> adminUser
Does not alter internal, intra-function variable naming conventions.
Comment #4
tibbsa commentedRerolled.
Comment #6
tibbsa commentedComment #7
tibbsa commentedLooks complete now.
Comment #8
cilefen commented@tibbsa: See the update to the parent issue.
Comment #9
cilefen commentedComment #10
tibbsa commentedI will check on this.
Comment #11
tibbsa commentedComment #12
tibbsa commentedCorrections for undefined properties and, in one instance, a doubly-defined adminUser. Note that CommentTestBase provides webUser and adminUser already, and so tests derived from CommentTestBase already include these properties.
Comment #13
cilefen commentedThere is a whitespace error and a mistype here. I would prefer 'A secondary user for posting comments.'.
This adminUser is configured with different permissions than in the parent class, so I would not remove the overridden property in this class.
I found some more to be changed:
Comment #15
tibbsa commentedWith respect to the reference to $this->column_map in FilterUserUIDTest where I simply removed the reference to $this->, that seems to be consistent with other tests (e.g. in ArgumentUserUIDTest and in several Views-specific tests). In other words, there seems to be no reason for this to be a class property in the first place.
Comment #17
cilefen commentedIt looks like CommentAttributesTest extends CommentTestBase, so you have to include that in this patch.
Comment #18
tibbsa commentedComment #19
cilefen commentedThere is usually a space after the class declaration, so don't remove it.
This comment must be on a single line. A full description can come after a full space.
The comment must end with a period, not a semicolon.
Same thing - must be one line.
This must end with a period.
Comment #20
tibbsa commentedComment #21
tibbsa commented@cilefen: Thank you for the assistance. I will rework those.
Comment #22
tibbsa commentedNo code changes here -- just docblock updates.
Comment #23
cilefen commented@tibbsa: Again, great work.
Please do not change anything in the RDF file that is not strictly necessary so we can keep this issue in scope. I think all that is needed is webUser(?). Could you please update this issue summary and #2381921: Clean-up RDF module test members - ensure property definition and use of camelCase naming convention accordingly?
Comment #24
tibbsa commentedThis is a revision of the patch in #22 to roll back all but the ->webUser changes on the RDF module.
Comment #27
subhojit777Comment #28
subhojit777Comment #29
subhojit777This changes were introduced during reroll
Comment #30
tibbsa commentedLooks good to me.
Comment #31
mile23CommentCSSTestline 131 missed a camelCase:CommentTranslationUITestline 24: No @var declaration.Comment #32
cilefen commented$expectedJS is not a class property, so no need to camelCase it.
Comment #33
mile23Yes, exactly. :-) It should be
$expected_js.Comment #34
cilefen commentedOh .. ha ha. That's correct. It's a little out-of-scope but we could fix it.
Comment #35
tibbsa commentedOh, now your comment in the other issue makes sense... OK, these issues were primarily concerned with fixing the class-level properties, given that people sometimes derive new tests from existing tests and undeclared, undefined inherited properties could be an issue. Intra-function issues and coding conventions were not really in scope for all of these changes (since they're unlikely to cause any fragility overall), but I suppose this could be fixed. But I wouldn't go back and do a whole bunch more work on all the other modules for it?
Comment #37
mile23In that case.... Will RTBC if it passes green. :-)
Comment #38
mile23The patch in #28 refactors class-level properties from under_score to camelCase as the coding standards demand.
I know this because I applied the patch, ran my own coding standards review with netbeansdrupalcomposed, and poked through all the test classes to find camel case and underscore violations. I found a few that were mentioned in #31, but those are apparently out of scope for this issue.
Comment #39
alexpottThat is not in commnet module.
Comment #40
cilefen commented@alexpott: RDF CommentAttributesTest extends CommentTestBase
Comment #43
rpayanmrerolled from #28
Comment #44
mile23Re-up my RTBC from #28.
As noted above, this patch touches more than the comment module because other modules use comment's test base classes.
Comment #45
tstoecklerLet's add a blank newline in between here.
This should be "install".
Comment #46
subhojit777Comment #47
subhojit777Comment #48
mile23Still applies, phpcs still tells me there are no underscore problems, and pulls in the changes from #45.
Comment #49
alexpottCommitted 09b496e and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation for to the issue summary.