Sadly, tests are often thrown together in response to the 'Needs tests' tag and use examples from within existing Test classes. As a result, when doing a review of our current Test classes focused simply on drupalCreateUser() using grep, there are numerous violations of Drupal's combined standards in http://drupal.org/node/1354 and http://drupal.org/node/325974.

For instance, there are numerous cases of $this->admin_user in core. According to our class coding standards, this should be something equivalent to '$this->adminUser'. Note the correction from admin_user to adminUser as a member of a class. Before this incorrect example gets used further, all current incorrect examples need to be corrected.

This patch attempts to bring Tests in modules N-Z closer to both of these standards. As a result, admittedly, it crosses both existing documentation and coding standards. However, at least to this patch creator, all of the changes seem to make sense as result of reading through a cross-section of our test classes. I am not aware of when before Drupal tests have attempted to ensure consistency with both of there standards.

Modifications to Tests in modules A-M are covered in issue #1803656: Improve Tests consistency to standards in modules A-M.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Lars Toomre’s picture

Status: Active » Needs review
FileSize
178.48 KB

Here is an initial patch that has not been tested locally for this issue. Let's see what the test bot thinks.

Status: Needs review » Needs work

The last submitted patch, 1804522-1-tests-consistency.patch, failed testing.

Lars Toomre’s picture

Status: Needs work » Needs review
FileSize
178.48 KB

Well, that was missing comma... Here is another untested patch.

Status: Needs review » Needs work

The last submitted patch, 1804522-3-tests-consistency.patch, failed testing.

Lars Toomre’s picture

Status: Needs work » Needs review
FileSize
178.45 KB

There were some stray characters in EntityFieldTest.php. Let's try that once more.

Status: Needs review » Needs work

The last submitted patch, 1804522-5-tests-consistency.patch, failed testing.

Lars Toomre’s picture

Status: Needs work » Needs review
FileSize
178.91 KB

Ugh... a silly copy and paste error in the last Test file. Hopefully, this is the last of the PHP syntax errors.

Status: Needs review » Needs work

The last submitted patch, 1804522-7-tests-consistency.patch, failed testing.

Lars Toomre’s picture

Status: Needs work » Needs review
FileSize
178.54 KB

Fixed the replacement error in BreadcrumbTest.php. Let's see how this untested patch does now.

Status: Needs review » Needs work

The last submitted patch, 1804522-9-tests-consistency.patch, failed testing.

Lars Toomre’s picture

Status: Needs work » Needs review
FileSize
181.67 KB

Something odd was going on with TaxonomyTestBase.php. Let's see if this fixes the problem. This is another untested patch since I do not have a local testing environment.

Status: Needs review » Needs work

The last submitted patch, 1804522-11-tests-consistency.patch, failed testing.

Lars Toomre’s picture

Status: Needs work » Needs review
FileSize
183.95 KB

I seems one cannot define a protected member of an abstract class like TaxonomyTestBase.php. I thought that one could.

Let's see how this untested patch with the declaration of 'protected $adminUser;' in each of the classes that extends the base class does.

Status: Needs review » Needs work

The last submitted patch, 1804522-13-tests-consistency.patch, failed testing.

Lars Toomre’s picture

Ah I removed too much from TaxonomyTestBase.php in #13. Let's see what test bot thinks of this untested patch.

Lars Toomre’s picture

Status: Needs work » Needs review

Grr.. remember to set the status.

Status: Needs review » Needs work

The last submitted patch, 15: 1804522-15-tests-consistency.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dawehner’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

Instead of doing something by module I think we should do something by concept. Otherwise it is basically impossible to review the changes done here.