Posted by cilefen on
The block 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.
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. |
Files:
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 4.13 KB | hussainweb | |
| PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 82,044 pass(es). [ View ] | |||
| #4 | 790 bytes | hussainweb | |
Comments
Comment #1
hussainweb commentedAttaching the changes for BlockCacheTest.php. I am not fixing the instance of
$this->root_userinBlockHtmlTest.phpbecause that is actually from\Drupal\simpletest\WebTestBaseand changing there may not be in scope of this issue.Comment #2
cilefen commentedThank you for working on this. It is good when we follow our own coding standards.
I agree on the root_user situation. We have to be sure it is considered when we fix the parent class.
+++ b/core/modules/block/src/Tests/BlockCacheTest.php
@@ -24,9 +24,9 @@ class BlockCacheTest extends WebTestBase {
+ protected $adminUser;
+ protected $normalUser;
+ protected $normalUserAlt;
Please comment these. Look around in other tests for what is usually used.
Comment #3
cilefen commentedComment #4
hussainweb commentedAdded comments.
Comment #5
tibbsa commented+ /**+ * A user with permission to create and edit books and to administer blocks.
+ *
+ * @var object
+ */
+
I suggest @var \Drupal\user\UserInterface rather than a very vague 'object' definition for these.
Comment #6
tibbsa commentedComment #7
Mile23 commentedThe patch in #4 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.
Comment #8
alexpott commentedCommitted aec18af and pushed to 8.0.x. Thanks!