Follow up for #1634442: DatabaseStorageController can't catch exceptions

Problem/Motivation

Non-blocking standards fixes from 1634442:

+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityApiTest.phpundefined
@@ -90,4 +91,52 @@ protected function assertCRUD($entity_type, User $user1) {
+    * Tests that exceptions are properly thrown when saving or deleting an
+    * entity.

function docs blocks should be one line < 80 chars.

+++ b/core/modules/system/tests/modules/entity_test/entity_test.moduleundefined
@@ -379,3 +379,21 @@ function entity_test_entity_form_display_alter(EntityFormDisplay $form_display,
+ * Implements hook_entity_presave()
...
+ * Implements hook_entity_predelete()

these should be sentences (end with a period)

https://drupal.org/node/1354#functions

All summaries (first lines of docblocks) must be under 80 characters, start with a capital letter, and end with a period (.). They must provide a brief description of what a function does, what a class does, what a file contains, etc.

Proposed resolution

fix those, and any thing else from entity_test.module,
like

Remaining tasks

Initial patch.

User interface changes

No.

API changes

No.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

YesCT’s picture

Oh, I thought those were all from one file, but one is also in EntityApiTest.php

yaworsk’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
1.76 KB

patch attached...

Status: Needs review » Needs work

The last submitted patch, 2: comment-updates-for-coding-standards-2039449-2.patch, failed testing.

yaworsk’s picture

Status: Needs work » Needs review
FileSize
1.63 KB

opps... had a random text string in there. updated patch attached.

Berdir’s picture

Status: Needs review » Needs work

The last submitted patch, 4: comment-updates-for-coding-standards-2039449-4.patch, failed testing.

YesCT’s picture

Issue tags: +Needs reroll
mrjmd’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
1.63 KB

Attempted a reroll.

mrjmd’s picture

I reviewed the original patch, it looks a bit incomplete:

- The function doc block for testEntityStorageExceptionHandling() was moved from two lines to one: "Tests that exceptions are properly thrown when saving or deleting an entity." This makes it more than 80 chars. I've removed the word 'properly', which is implied, to get it back under 80 chars.
- One comment missing a period at the end.
- One comment with a comma instead of a period.
- Also the original issue mentions "type casting in function entity_test_label_callback", but I don't see that function in either file so I'm thinking that's been rendered obsolete?

New patch rolled based on the same coding standards info linked above, https://drupal.org/node/1354#functions.

mrjmd’s picture

FileSize
1.94 KB

Adding interdiff.

YesCT’s picture

Title: Standards followup from DatabaseStorageController can't catch exceptions, in entity_test.module » Some standards fixes from "DatabaseStorageController can't catch exceptions", in entity_test.module and EntityApiTest.php
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Related issues: +#1634442: DatabaseStorageController can't catch exceptions

git log -S "entity_test_label_callback" core/modules
reveals
#2134857: PHPUnit test the entity base classes removed function entity_test_label_callback().
Updated issue summary.

interdiff looks good.

I think to limit the scope and get this Novice in, retitling.

I checked for other missing period-on-sentences kind of thing and this has them all from the .module file. This looks good! rtbc.

YesCT’s picture

Title: Some standards fixes from "DatabaseStorageController can't catch exceptions", in entity_test.module and EntityApiTest.php » Some standards fixes in entity_test.module and EntityApiTest.php motivated by "DatabaseStorageController can't catch exceptions",

more accurate title

YesCT’s picture

Title: Some standards fixes in entity_test.module and EntityApiTest.php motivated by "DatabaseStorageController can't catch exceptions", » Some standards fixes in entity_test.module and EntityApiTest.php, motivated by "DatabaseStorageController can't catch exceptions"

sorry. :/ punctuation.

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x, thanks all!

  • Commit b78effb on 8.x by jhodgdon:
    Issue #2015849 by mrjmd, yaworsk, YesCT: Comment standards fixes in...

Status: Fixed » Needs work

The last submitted patch, 9: comment-updates-for-coding-standards-2039449-9.patch, failed testing.

YesCT’s picture

#2212283-12: Auto-format JS files just failed with that same fail.

let's see what 8.x head test says https://qa.drupal.org/8.x-status

jhodgdon’s picture

Status: Needs work » Fixed

This patch was already committed and there is no way the failure was related to this patch, which only touched comments.

Status: Fixed » Closed (fixed)

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