Follow-up to #1811638: [meta] Clean-up Test members - ensure property definition and use of camelCase naming convention

This is the final cleanup of module-based tests for the parent meta. Evidently some new commits have re-introduced the things we would like to get rid of. See #1811638-81: [meta] Clean-up Test members - ensure property definition and use of camelCase naming convention

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
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.

Comments

cilefen’s picture

Issue summary: View changes
rpayanm’s picture

Assigned: Unassigned » rpayanm
rpayanm’s picture

Assigned: rpayanm » Unassigned
Status: Active » Needs review
StatusFileSize
new29.62 KB

Please review.

Status: Needs review » Needs work

The last submitted patch, 3: 2463417-3.patch, failed testing.

rpayanm’s picture

Status: Needs work » Needs review
StatusFileSize
new751 bytes
new30.36 KB

Let me see now.

Status: Needs review » Needs work

The last submitted patch, 5: 2463417-5.patch, failed testing.

rpayanm’s picture

Status: Needs work » Needs review
StatusFileSize
new30.37 KB

Yeah!

Status: Needs review » Needs work

The last submitted patch, 7: 2463417-7.patch, failed testing.

rpayanm’s picture

Status: Needs work » Needs review
StatusFileSize
new1.8 KB
new29.63 KB

Let me see now.

joelpittet’s picture

Status: Needs review » Needs work

This looks good @rpayanm. I reviewed the changes and they all look great. Just a little nitpick before I RTBC this:

  1. +++ b/core/modules/block_content/src/Tests/Views/BlockContentFieldFilterTest.php
    @@ -34,7 +34,7 @@ class BlockContentFieldFilterTest extends BlockContentTestBase {
    -  public $block_content_infos = array();
    +  public $blockContentInfos = array();
    
    @@ -54,17 +54,17 @@ function setUp() {
    -    $block_content = $this->createBlockContent(array('info' => $this->block_content_infos['en'], 'langcode' => 'en', 'type' => 'basic', 'body' => array(array('value' => $this->block_content_infos['en']))));
    +    $block_content = $this->createBlockContent(array('info' => $this->blockContentInfos['en'], 'langcode' => 'en', 'type' => 'basic', 'body' => array(array('value' => $this->blockContentInfos['en']))));
    ...
    +      $translation = $block_content->addTranslation($langcode, array('info' => $this->blockContentInfos[$langcode]));
    
    +++ b/core/modules/node/src/Tests/NodeAccessBaseTableTest.php
    @@ -59,10 +92,12 @@ function testNodeAccessBasic() {
    +    $titles = array();
    ...
    +    $private_nodes = array();
    
    @@ -149,11 +184,11 @@ function testNodeAccessBasic() {
    +      $this->nidsVisible = array();
    
    +++ b/core/modules/node/src/Tests/NodeAdminTest.php
    @@ -38,9 +59,9 @@ protected function setUp() {
    +    $this->baseUser1 = $this->drupalCreateUser(array('access content overview'));
    +    $this->baseUser2 = $this->drupalCreateUser(array('access content overview', 'view own unpublished content'));
    +    $this->baseUser3 = $this->drupalCreateUser(array('access content overview', 'bypass node access'));
    
    +++ b/core/modules/node/src/Tests/NodeRevisionPermissionsTest.php
    @@ -13,7 +13,19 @@
    +  protected $nodeRevisions = array();
    
    +++ b/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php
    @@ -33,7 +33,7 @@ class NodeFieldFilterTest extends NodeTestBase {
    +  public $nodeTitles = array();
    
    +++ b/core/modules/node/src/Tests/Views/NodeLanguageTest.php
    @@ -37,7 +37,7 @@ class NodeLanguageTest extends NodeTestBase {
    +  public $nodeTitles = array();
    
    +++ b/core/modules/views/src/Tests/Plugin/NumericFormatPluralTest.php
    @@ -36,13 +36,13 @@ class NumericFormatPluralTest extends ViewTestBase {
    +    $this->webUser = $this->drupalCreateUser(array('administer views', 'administer languages'));
    

    As long as they don't change the diff hunk size I'd say may as well use the short array syntax.

  2. +++ b/core/modules/node/src/Tests/NodeAdminTest.php
    @@ -23,6 +23,27 @@ class NodeAdminTest extends NodeTestBase {
    +  protected $baseUser3;
    +  ¶
    +  /**
    

    Got some extra whitespace left in here.

Here is the regular expression I used to weed out any stragglers... which there are none.

\$this\->[^(;\s]+_[^(;\s]+

hussainweb’s picture

Status: Needs work » Needs review
StatusFileSize
new6.85 KB
new29.54 KB

Fixed both points in #10.

joelpittet’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Awesome, thank you @hussainweb.

mile23’s picture

It doesn't look like there's overlap, but this issue looks like a cleanup issue after the rest of the module test issues from the meta are done.

There's only one remaining issue in this scope, and it's for the forum module: #2396649: Clean-up forum module test members - ensure property definition and use of camelCase naming convention

So just avoid forum module for now. :-)

I'd also say this issue should be postponed on that one, but let's keep going here if there's anything else to add.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/views/src/Tests/Plugin/NumericFormatPluralTest.php
@@ -36,13 +36,13 @@ class NumericFormatPluralTest extends ViewTestBase {
    *
    * @var \Drupal\user\UserInterface
    */
-  protected $web_user;
+  protected $webUser;
...
-    $this->web_user = $this->drupalCreateUser(array('administer views', 'administer languages'));
-    $this->drupalLogin($this->web_user);
+    $this->webUser = $this->drupalCreateUser(['administer views', 'administer languages']);
+    $this->drupalLogin($this->webUser);

No need for the property.

cilefen’s picture

Status: Needs work » Needs review
StatusFileSize
new842 bytes
new29.64 KB
joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @cilefen for the quick fix.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed b75b691 and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation to the issue summary.

  • alexpott committed b75b691 on 8.0.x
    Issue #2463417 by rpayanm, cilefen, hussainweb: Clean-up remaining test...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.