The DateTime 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

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

tibbsa’s picture

Status: Active » Needs review
StatusFileSize
new3.58 KB
tibbsa’s picture

Assigned: tibbsa » Unassigned
mile23’s picture

Status: Needs review » Reviewed & tested by the community

After applying the patch, phpcs says no coding standard errors at all in core/modules/datetime/src/Tests/. I'd call that some kind of miracle.

cilefen’s picture

Status: Reviewed & tested by the community » Needs work
  public function testDateTimeItem() {
    // Verify entity creation.
    $entity = entity_create('entity_test');
    $value = '2014-01-01T20:00:00Z';
    $entity->field_datetime = $value;

field_datetime is not declared.

DateTimeFieldTest:

$this->display_options

Not declared.

cilefen’s picture

Status: Needs work » Reviewed & tested by the community

Oops, wrong patch.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1: datetime-testing-camelcase-2384167-1.patch, failed testing.

cilefen’s picture

Status: Needs work » Reviewed & tested by the community
+++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
@@ -36,6 +36,14 @@ class DateTimeFieldTest extends WebTestBase {
+

Nit: extra newline here.

mile23’s picture

Looks green and pass-y. RTBC stays.

Original RTBC comment in #3.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 827b39b and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation for to the issue summary.

diff --git a/core/modules/datetime/src/Tests/DateTimeFieldTest.php b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
index 27afb5b..2de16ee 100644
--- a/core/modules/datetime/src/Tests/DateTimeFieldTest.php
+++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
@@ -42,7 +42,6 @@ class DateTimeFieldTest extends WebTestBase {
    */
   protected $displayOptions;
 
-
   /**
    * A field storage to use in this test class.
    *

unless extra blank line added - removed on commit.

  • alexpott committed 827b39b on 8.0.x
    Issue #2384167 by tibbsa: Clean-up DateTime module test members — ensure...

Status: Fixed » Closed (fixed)

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