Download & Extend

Remove generic comments from inherited test methods

Project:Drupal core
Version:7.x-dev
Component:ajax system
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Based on the discussion on http://groups.drupal.org/node/7731, it appears that putting comments for inherited test methods like getInfo(), setUp() and tearDown() is generally confusing. Rather than treating them like hook implementations or having a generic comment being repeated, it would be cleaner to not have comments at all. This opinion is shared by many people including dww, moshe and drewish.

Here's a patch based on a regular expression to remove all comments from getInfo(), setUp() and tearDown() functions in .test files.

For the reference, here's the regexp:
In *.test files, replace

([^\n]*\/\*\*\n.*\n\s*\*\/\n)(\s*)function (getInfo|setUp|tearDown)

with
$2function $3
AttachmentSizeStatusTest resultOperations
test_comment_cleanup.patch50.49 KBIdleFailed: Failed to apply patch.View details

Comments

#1

Status:needs review» needs work

The last submitted patch failed testing.

#2

FWIW, I totally support this change. ;)

#3

Component:tests» ajax system
Status:needs work» closed (fixed)

It seems that the generic comments have been removed. This produces nothing now:
grep -r '([^\n]*\/\*\*\n.*\n\s*\*\/\n)(\s*)function (getInfo|setUp|tearDown)' .

Closing the issue :)